code:https://ide.codingblocks.com/s/323448
prb:https://www.spoj.com/problems/GSS1/
What is mistake in my code
@spagire4
Your build function was correct. There were issues in your query function. You do not manipulate the x and y pointers because they are used to verify the region you have arrived at if it belongs to the answer or not. You instead manipulate the s and e pointers which initially pointed to 0 and (n - 1).
This is the updated code. Please refer to this.
If my solution was able to answer your query, please mark the doubt as resolved.