Comments

Thanks , got it now.

How to solve problem E?

I got it now. Thank You everyone.

Can anyone please briefly explain the claim em - k <  = C.m1 / 3 that is made in the editorial for problem F.

First of all frequency of all the strings should be same. Then imagine your initial ans is the first given string. Now generate all the possible strings by swapping two characters of that string. Now you have to calculate the hamming distance with all other strings.If the calculated hamming distance for all the given string is 2 or 0(if there is a duplicate character) then you got your ans.

If you make a swap then at most two or at least 0 character will change its position (if the swapping characters are same). So for the hamming distance 1 ans should be -1.

-10

M.Mahdi Can you please provide your solution?

Can E be solve by dynamic programming?If so then what is the approach?