its running right for the sample test cases but is failing on submission.
WRONG ANSWER ON SUBMISSION
hello @akshatsaraswat03

a)use if - else if - else
b) that if statement is not required because u are converging from two extreams so new differnce between arr[l] arr[r] will always be less than the previous one.
it still doesn’t work
wait i m checking . . .
you have written price in place of prices.
check ur updated code here ->
Stupid mistake. Sorry to bother you!