please help getting 2 wrong test cases
I am getting 2 wrong test cases
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
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.
there might be some issue with cb checker