Why haven’t we put a if block in the end and checked if the map not contains pre and added it
Doubt in if else block
hello @unforgettable_pawan
yeah that is a mistake in the video.
there should be if statement to check whether pre exist or not , if it exist then continue otherwise add pre and its index.
are you sure about it?
yeah . . . . . . . . . . . . . . . . .
okay thanks…
I have one more doubt so the same changes will also be there in the previous question where we have to find the longest subarray with sum zero
yeah . . . . . . … . . . . .
Okay Thanks…
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.