Solve the spiral problem. There are many ways to solve the problem. Here we list 4 ways to solve the problem. You can choose any one of them.