# Puzzle | King Octopus and Servants

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:

1. Servant A said, “Altogether we have 28 legs.”
2. Servant B said, “Altogether we have 27 legs.”
3. Servant C said, “Altogether we have 26 legs.”
4. 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.
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Previous
Next