Ad
  • Default User Avatar

    I think the problem is not so much the test cases but the order in which the set() arranges all the letters. Because there are times in which only 1 iteration through the triplets won't be enough to rearrange properly the letters in r. This is because of the nature of the random sorting of the set() module. If it runs twice as azzbcc says it works, but maybe it's overdoing it.

    having said that, it's a wonderful solution...