I have an approach. Let's make a set of all positive numbers present in given array. Then iterate a new loop. In the loop, if any consecutive number doesn't match, break it. The point where it was broken, the value of i is the answer
I couldn't understand the time complexity. Are you sure its O(n). It would be great help if you can explain the complexity part in details. In your example the loop runs 10 times even though you have only 7 elements. Could it happen that the loops runs about n*n times ? In an array where every elements have to swipe multiple times?
I tell you what, you programmers are clever as fuck but by Jesus can you not simply explain anything without throwing in random numbers for no reason or other answers to other questions that aren’t anything to do with the question in mind 😂
I saw 2-3 videos of this particular question but still was not able to understand this. Your video explains it all. Thank you.
Thanks for your nice feedback. Keep Watching.
Can't believe this video has such less views. This is better than the Aman Dhattarwal's one. Sir, just please uploading these videos.
Thanks for your nice feedback. Keep Watching.
best explanation than others
Thanks for your nice feedback. Keep Watching.
Your's explanation level is superbbbbb🔥
Thanks Rafat for your feedback. Keep Watching.
simple and clear explained!
Thanks for your nice feedback. Keep Watching.
I have an approach. Let's make a set of all positive numbers present in given array. Then iterate a new loop. In the loop, if any consecutive number doesn't match, break it. The point where it was broken, the value of i is the answer
i was thinking same thing
@@shanukatiyar2742 yes it's a nice one
THANK YOU SOOO MUCH ! :)
Glad you liked it. Keep Watching.
@@CodingSimplified Andhariki oke reply icchi ammayi kanapadagaane marchesaavu .
Great explanation , superbb
Why did you you use "else i++ "?
Can I write directly i++? Inside the while loop...
alwys love ur lectures sir ,,you
Thanks for your nice feedback. Keep Watching.
I couldn't understand the time complexity. Are you sure its O(n). It would be great help if you can explain the complexity part in details. In your example the loop runs 10 times even though you have only 7 elements. Could it happen that the loops runs about n*n times ? In an array where every elements have to swipe multiple times?
Its not n*n, it’s n + n = 2n which is o(n)
sir why didnt you code this in nLOGn?That is faster than O(n)?
O(n*logn) is slower than O(n). Hope it helps you. Thanks.
what if the array is [ 100,900,-100,120] like this?
great explanation
Thanks for your nice feedback. Keep Watching.
Thank you!!
Thanks for your nice feedback. Keep watching.
Bruhhh sooo good
Thanks for your nice feedback. Keep Watching.
but it is giving TLE sir for this method
what if array contains 0
+1 subscriber
Suup!!!
Thanks for your nice feedback. Keep Watching.
u lost me at 6.45
I tell you what, you programmers are clever as fuck but by Jesus can you not simply explain anything without throwing in random numbers for no reason or other answers to other questions that aren’t anything to do with the question in mind 😂