Hello all,
I've given amazon test today morning and got the below problem, i think this question needs segment trees but i couldn't think of approach. can someone please let me know how this can be solved, or approach

image

image

image

image

Comments (8)