About June Long Challenge - Math-Contest

I saw your solution, you are running a loop in L to R in each query, it will easily get timed out if difference between L to R is fairly large for each query irrespective of the array elements.

I know my solution is not efficient thatā€™s why Iā€™m shocked to know it is AC in O(nq) for some peoplesā€¦