Sanket and strings

kindly help me out with ques sanket and strings

This problem can be solved with help of two pointers. Let the first pointer is “lt” and the second pointer is “rt”. Then for every position “lt” we will move right end “rt” until on the substring si to si + 1… 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 “lt” to the right.

Since, you arent replying anything, I am marking this doubt as resolved… You can reopen it if u still face any issues…