I've had this puzzle on my phone for years. Every few months I'd glance at it and try and solve it. Last night, as I was eating dinner, I finally figured out the answer!

https://sh.itjust.works/post/55641581

I remember doing decision trees at Uni, and saw it immediately. Glad you got there OP.