Find the Defective Ball

You have 12 balls all look identical (in shape, color etc.).
All of them have same weight except one defective ball.
You don’t know that the defective one is heavier or lighter than other balls. You can use a two sided balance system (not the electronic one).

Find the minimum no. of measures required to separate the defective ball.

Answer is a integer. Just put the number without any decimal places if its an integer. If the answer is Infinity, output Infinity.

Feel free to get in touch with us if you have any questions

Hints
  • Complete Solution
3073 successful submissions.
Asked In:
  • Microsoft
Click here to jump start your coding interview preparation