You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are going through the array ans checking if the number right left to it is smaller to it then answer for that is (i-1) else we will check position ans[i-1]
5
+
if we encounter ans[i]=-1 we know there is no number smaller than that so the ans is -1
0 commit comments