Use frequency hashes for data storing and manipulation
See my code :::
https://www.codechef.com/viewsolution/14110320
Add a condition between your loops about sum of lengths of array being less than k, if sum of length is less than k, don’t proceed. For details check : https://www.codechef.com/viewsolution/14098476
1 Like