I am getting 2 wrong test cases

please help getting 2 wrong test cases

hello @raghavkhaterpal
wait i checking

hey ur logic is correct,but it has time complexity of O(N^2).
because for each index i. u will take complete n round.
try to think of O(n) approach.

video ediotrial is also available for the same

no i am getting wrong answer

not tle and also this is the solution explained

i have followed them only and i know it is n^2 worst case

image
why r u printing -1.
here u should print ans

yea i have done that change still 2 test cases not working

ur code is working fine on leetcode.
image

there might be some issue with cb checker