I think the condition at line number 27 will always be true because control came to the else loop since it had odd number of negative numbers and in that case sn!=-1 will be surely true Hence we can write line number 27-28 as :- ans = max(ans, max(e-sn-1, en-s);
i tried the same thing at the code while(nums[e] != 0 && e < n) leetcode gives heap buffer overflow(index out of bound ) but how it is working on this ide.
very helpful and clean code, i implemented the same method as yours which was given in the hint section of the leetcode problem but wrote such a messy code and it didn't worked.
Thank you for the explanation. I couldn't do it at first but after watching the idea behind your solution, I could write the code myself.
I think the condition at line number 27 will always be true because control came to the else loop since it had odd number of negative numbers and in that case sn!=-1 will be surely true
Hence we can write line number 27-28 as :- ans = max(ans, max(e-sn-1, en-s);
i tried the same thing at the code while(nums[e] != 0 && e < n) leetcode gives heap buffer overflow(index out of bound ) but how it is working on this ide.
nice explanation.
very helpful and clean code, i implemented the same method as yours which was given in the hint section of the leetcode problem but wrote such a messy code and it didn't worked.
Good Explaination and Approach... Thanx Fraz
Thanks Fraz , Understood
Great Explanation !!!
Thanks ☺️
🔥++
crystal clear explanation!! Thanks brother.
Thankyou bhaiya for this session
Really helpful video, thanks brother
Very beautiful explanation. An easy problem though.
Thank you so much for the explanation.
Real nice explaination
Thanks a lot...
Thanks. This is a good one.
Clearly explained 🔥
i got a TLE on leetcode
☹️😭