Logic is just insane...dont know when i will think like this...
@mikedelta6589 ай бұрын
Fantastic. Thank you.
@chandansahu23402 жыл бұрын
finest explaination on the whole internet.
@rahulrandhiv2 жыл бұрын
in the second approach, you don't need idx, replace it with i
@purplewombat67352 жыл бұрын
best explanation of this problem! I feel approach #2 was my missing key to understand approach #3
@rohitsoni24393 жыл бұрын
thanx for explaining
@PJcreationss3 жыл бұрын
Very good explanation
@digvijay12282 жыл бұрын
Could you please explain why you took arr[idx] - (idx+1) < k condition. What was the intuition behind this. Sorry I couldn't understand, you said if arr[i] - (i+1) == 0 means no missing number, but if it is greater than zero means those many missing numbers. I just can't get to the final condition. correct if i'm wrong
@hksubs2 жыл бұрын
Thanks , i. like how you progress the code to optimal way. Can you please explain more why you set "idx = i + 1"? can "i" be eliminated?