Given example test case of SEATSR

The third example test case provided in problem SEATSR of October long challenge is not clear to me.
The test case is -
Input-
baaaaa

aaaaab

1 100 100
Output-
2

How can the answer be 2 for that. For me it is 4.
Please someone explain this to me.
Thanks.

U can delete the ‘b’ from the start and then add it to the end. 1+1=2, 1 for insertion, 1 for deletion.

2 Likes

Phheww…finally. Thanks a lot. :slight_smile:

1 Like

best of luck! :slight_smile:

ohh…just 1 more thing…what i know is this -
say if we have BAABAAB and AABAABB, we can remove first B and add to the end.
But in case of AABAAA and AAAAAB we cannot just pop the B and add it to the end.
For this we have to remove first 2 A’s and B and then add all three A’s.

Is it so?
Thanks again.

Nope u can! Its written clearly… Remove a character from any position of the string. ANY position. U can directly delete b and add one B to the end.