Problem : HELPR2D2 — Help R2-D2!
Solution : Link
Approach : I stored in each leaf node K(Volume left to use) and in the parent node, I summed up the volume of children's node. For querying, I try to go as much left as I can and update the volume used. I cross-checked with several cases. But cannot find where it's going wrong on submission.
If someone has solved this question, I really appreciate your help. Thank you!