KQUERY0 - SEGMENT TREE

getting run error i test cases
ide: https://ide.codingblocks.com/s/234419

@Vishal123
You didn’t comply with these instructions in the question
if i > j answer is 0.

if i < 1 take i =1.

if j > n take j = n.
So you might be sending i>j or i<0 j<0 or i>=n or j>=n so run time error