Not getting correct output
so I applied the same logic told in the video where we have cases first if a number just one lower and number just one higher to the number doesnโt exists then streak becomes 1 , if both one lower and one higher number is there the streak = old left streak +1 +old right streak we store the new streak value only in the starting and ending element of streak as only they will be responsible for expanding streak, third if only one less than the existing number exists then new streak = old left streak+1 same can be done for right . Then compare max from all
try printing each pair of map and see what content it is storing.
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.