are both fine). Permutations and fast cycle decomposition. The idea is to do the work of decomposing a permutation into cycles only once, in O(n) ...
確定! 回上一頁