and if length is correct??
How to print array in 1 count?
@shivansh.sm1,
While using the 2 pointer/moving window approach, you can simple maintain two variables which store the left and right of the largest window, i.e they are updates every time max_length is updated.
Then afterwards, you can simply iterate between these max_indexes, and mark all as 1 and print the array.
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.