News for hackers. Stuff that matters.
Re:Data structures and algorithms problems in C++ using STL by davidtgoldblatt on Friday March 10, 2017 @02:24PM (#13841265)
I think you're on the right track (i.e. viewing it as a permutation, and looking at the cycle decomposition of that permutation).

Try indexing from 0 instead of 1 if you're not. Then the cycle containing 1 will start with (1, 2, 4, 8, ...). What happens when it wraps around?

There are no comments on this comment yet.