Not able to clear the first two test cases as i am getting TLE for it
Hello @shubhankar1996.dob1 yes your code is fine but it is not optimised that is the problem with this code:
you should use the queue or deque for it and this will make the logic optimsed:
in this question you should use the queue to find the maximum in the window of that string.
Here for your reference i am attaching the code:
if you have any doubt you can ask here:
Happy Learning!!
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.