Am I the only one here who thinks that triple sort is just an easy version of this problem? please correct me if I am wrong

PROBLEM LINK: Problem - 1012E - Codeforces

7 Likes

Seems to be similar.

I think so too

Another easy version on hackerrank.

2 Likes

yes it was a bit same

The problems clearly ask for different things. Furthermore, the solutions described also have absolutely nothing in common. The only way I see this CF problem could help with TRPLSRT is to set s=3K and find the cycles needed to sort the permutation. Even after doing that you would still have to transform the cycles of various lengths to the ones of length 3 - which is exactly what TRPLSRT is all about - how to represent a permutation as a product of cycles of length exactly 3. All in all, the CF problem only offers an overkill algorithm for extracting the cycles (or swaps) out of the permutation, after which TRPLSRT remains completely intact.