not able to pass a testcase
SANKETandSTRINGS1
@Saransh99 hey saransh
This problem can be solved with help of two pointers. Let the first pointer is l and the second pointer is r. Then for every position l we will move right end r until on the substring si.si + 1… sr it is possible to make no more than k swaps to make this substring beautiful. Then we need to update the answer with length of this substring and move l to the right.
if I will give hint about fail test set you will not understand because it is very large . if you want me to hint how to write two pointer approach I can help you out with you a hint.
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.