Please answer the recruitment question of Microsoft.

You can weigh it out. The method is:

1, take 8 upper balances at will, and each group is 1. Then:

1. 1: The balance is balanced, and the problem ball is in the remaining four boxes (I don't know the weight).

1.2: The balance is tilted, and the problem ball is among the eight balls on the balance.

Let's discuss the case of 1.2 first.

2. Take out three balls from one end of the balance, fill three balls without problems, and exchange the remaining one with a ball at the other end, which is called the second time. Then:

2. 1, balance balance. The problem is that the weight of the three balls removed is known (the result of combining 1.2).

2. 1. 1, among the three balls taken out, take two balls to the balance (for the third time):

The balance is balanced, and what is not on the balance is a bad ball.

B the balance is tilted and can be judged according to the weight.

2.2, the balance tilt is unchanged, indicating that the problem has nothing to do with exchange, and the weight of the three balls that have not been moved on the balance is known (combined with the result of 1.2). At this point, just call the method of 2.2. 1 for the third time.

2.3, the tilt of the balance, the problem is in the exchange of two balls, but I don't know the weight. Take any 1 balance on the ball without any problem (the third time), and you can do it: imbalance is this one and balance is the other.

Let's discuss the case of 1. 1 again.

2.4. Of the remaining four balls, take any three balls and a good ball and put them on the balance, and make a group of every two balls (called the second time). Then:

2.4. 1, the balance is balanced, and there is something wrong with the ball that is not on the balance.

2.4.2, the balance is tilted, and all three balls on the balance have problems.

2.5. Take two good balls from one end of the balance and 1 ball from the other end. Then:

2.5. 1, balanced, there is something wrong with the ball that just took off.

2.5.2, the tilt direction of the balance remains unchanged, and there is something wrong with the ball that didn't move just now.

2.5.3, the balance turns in an oblique direction, and there is something wrong with the ball that just moved (turned).

At this point, the ball in question has been found.