Ten Black and White Socks

There are 10 black socks and 10 white socks in a drawer.Now you have to go out wearing your shoes.
So how many maximum number of times you need to remove the sock from drawer so that you can go out?

You can remove only 1 sock at a time.
You can’t look at the drawer while removing the socks.

Obviously, you can’t go outside wearing different socks!

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
3479 successful submissions.
Click here to jump start your coding interview preparation