Editorial for STRMRG

Can some explain how to solve the question STRMRG from JAN Long?

1 Like

the main thing we dont need same element consecutively so create two new string from string a and b now this will be going to be our ans.
now we can create our answer with sum of new strings.
but there can be possibility when we combine new string there can be consecutively same element.
to exclude this we need to find Longest Common Sub sequence. so we can exclude maximum no of elements from our ans.
now just exclude this count from your answer.

2 Likes