Comments
0

well your array starts from position 0. Position of 47 is 1 and of 23 is 3. The Query will give you an answer for [l, r) so you should pass as arguments (1, 4). Hope it helps!

You are already able to do that until January 10. Go to the profile Page->Settings->Handle

This is the solution I used too! Except that instead of Segment Tree I used an RMQ so the complexity becomes O(N log N + Q * N)

ok