Emptying Two Piles — Solution & Editorial
Each move removes 3 coins total, so 3 | (A+B); and neither pile may exceed twice the other (the bigger pile loses at most 2 per move). Both conditions together are sufficient.
Complexity: O(T)
Each move removes 3 coins total, so 3 | (A+B); and neither pile may exceed twice the other (the bigger pile loses at most 2 per move). Both conditions together are sufficient.
Complexity: O(T)