logoalt Hacker News

inigyoutoday at 10:59 AM0 repliesview on HN

The specification was extremely clear on this point. 5 is the input, so 5 must be in the output exactly once. And 5 is in the input, so 5 must be in the output exactly once. It doesn't say anything about "tracking a permutation chain". Any output containing exactly two 5s violates the spec. You need a different spec because this one is clearly not what you intended, which is the point.