I had to add the following code after line 17 of your code to ensure that one of the pointers doesn't become out of bounds. I was using Python. if first == n or second == n: return False
I didn't understand the use of limit_idx. I tried this qestion in leetcode without using limit_idx and was able to solve all the testcase without it. Is I am missing something?
The movable distance (prev_idx) is not needed, just remove it from the code, it still works. Thanks
sir you deserve millions of likes and subscribe for your hardward. Hats off !
bestest explanation for such a question!
Thanks 🙂
Best explanation, thanks!
Glad it was helpful!
Very helpful
nice 👍🏼
Thank you 🙏🏻 well understood 🎉
great :)
Thank you sir :)
welcome :)
thank you!
welcome :)
well explained
thanks :)
how can you say that we need to do below 10^8 like i don't know how anyone can tell just from seeing constraints if n*n will be passed or not ?
If N=10^8 takes 1 second , please tell what it takes for n^2 and if it's feasible.
It all can be said before even starting to think about an algo :)
That's how good programmers always get AC in one attempt.
@@techdose4u oh ok i was just curious that how do you know it takes 1 sec for 10^8 ops but i read an article and got it , thx
@kanaklata3421 yep its a set standard to make every submission fair and independent of machine power.
Thankyou sir
Welcome
I had to add the following code after line 17 of your code to ensure that one of the pointers doesn't become out of bounds. I was using Python.
if first == n or second == n:
return False
i think that is true right?
Man you are amazing :)
Appreciate the support!
I didn't understand the use of limit_idx. I tried this qestion in leetcode without using limit_idx and was able to solve all the testcase without it. Is I am missing something?
even if you don’t use it will work.
but that is to explain the allowed movements
sir you deserve millions of likes and subscribe for your hardward. Hats off !
hardwork*
Thanks for your kind words :)