Approach hintTry it first, then revealHide
With at most 15 rotations there are only 2^15 direction choices; recurse over the rotations, adding or subtracting each angle, and test whether any total is divisible by 360.
With at most 15 rotations there are only 2^15 direction choices; recurse over the rotations, adding or subtracting each angle, and test whether any total is divisible by 360.