Used approach:m1 maps all string (prefix,suffix)->no.of time and m2 maps to its length(hash)
eg: string abcd
m1(a,d)->1(no., times) m2(a,d)->1(length)
and sort according to length then coming from bottom(descending order) and decreasing no. of times for the removed string which is already considered in some pair(dehash).
Problem - https://www.codechef.com/problems/ENGLISH
My submission - https://www.codechef.com/viewsolution/28963265