** Puzzle:** There was a water kingdom where lived a king octopus with his few servants. The servants either had 6, 7 or 8 legs. It is known that:

- 7 legged servant always lied.
- 6 and 8 legged servants always said the truth.

One fine day, four servants gather before the king and they came up with 4 statements:

- Servant A said, “Altogether we have 28 legs.”
- Servant B said, “Altogether we have 27 legs.”
- Servant C said, “Altogether we have 26 legs.”
- Servant D said, “Altogether we have 25 legs.”

How will King Octopus find the truthful speaker?

** Solution:** As we can see that the four are making different statements and since one of them speaks the truth that means three of them are definitely lying. This forms the base of our argument.

**Step 1:**So, the three lying servants must have 7 legs each, resulting to 21(7 + 7 + 7) legs.**Step 2:**Now the fourth servant who is speaking the truth must have 6 or 8 legs.- Adding 21 to 6 gives 27 legs.
- Adding 21 to 8 gives 29 legs.

**Step 3:**Since 29 legs are out of the options, so it is proved that the 27 legs are the correct answer and Servant B is the truthful one.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Puzzle 49 | King and his Elephants
- Puzzle | Nineteen Pirates and the King
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle | 3 Priests and 3 devils Puzzle
- Puzzle 24 | (10 Coins Puzzle)
- Puzzle 27 | (Hourglasses Puzzle)
- Puzzle 28 | (Newspaper Puzzle)
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 31 | (Minimum cut Puzzle)
- Puzzle 33 | ( Rs 500 Note Puzzle )
- Puzzle 36 | (Matchstick Puzzle)
- Puzzle 38 | (Tic Tac Toe Puzzle)
- Puzzle 39 | (100 coins puzzle)
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle 85 | Chain Link Puzzle
- Puzzle | Elevator Puzzle
- Puzzle 7 | (3 Bulbs and 3 Switches)
- Puzzle 10 | (A Man with Medical Condition and 2 Pills)

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.