in this question we checked weather pre-k is available or not but we didnt check that no is previously avaialble or not so we are storing the first occurency
In this question we checked weather pre-k is available or not but we didnt check that no is previously avaialble or not so we are storing the first occurency
we need to check for both in our map. then only we will be able to generate longest subarray.
ie if we have seen pre first time then only add it to map.
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.