Posted: Wed Jan 01, 2003 9:16 am
Yes, weird description.
I guess this is what the author hid.
Suppose you use recursive function f(n) to generate permutations of the first n Titans. When you decide which guy to swap with the rightmost.
- n odd: Make the leftmost guy happy.
- n even: Blindly select one-by-one, left-to-right.
Thanks to Adrian and Snap. I got AC.
I guess this is what the author hid.
Suppose you use recursive function f(n) to generate permutations of the first n Titans. When you decide which guy to swap with the rightmost.
- n odd: Make the leftmost guy happy.
- n even: Blindly select one-by-one, left-to-right.
Thanks to Adrian and Snap. I got AC.