6 ms·
Well, due to it being divisible by 3, possible end states just mean that you can just make an arbitrary permutation within each triplet of cards. But you can do
by Roukanken 2y ago
Well, due to it being divisible by 3, possible end states just mean that you can just make an arbitrary permutation within each triplet of cards. But you can do that simply in exactly N/3 casts, at which point it's probably just easier to simulate them.