Game Of Strings , IIITT Woc question

Can anyone share their approach to solve this question. I am trying to solve but got WA. Click here for the question.

Thanks,
HSP

i hope this article will help you out
link:-Find if an array of strings can be chained to form a circle | Set 1 - GeeksforGeeks

https://www.codechef.com/viewsolution/29198648

Hope this helps
i tried this code even without sort in line 14 still works