Skip to main content
2 of 3
added 6 characters in body
hexomino
  • 139.1k
  • 10
  • 397
  • 575

Here's how to approach it in general

If Person 1 says there at least $k$ liars and Person 2 says there are at least $j$ liars, with $j \leq k$ then Person 1 being a truthteller implies Person 2 is a truthteller and Person 2 being a liar implies Person 1 is a liar.

This means that if you can identify $k$ such that the number of people who say "there are at least $m$ liars" with $m>k$ is $k$, then there exists a solution and the number of liars is $k$. Notice that if a solution exists, it will be unique. If no such $k$ exists then the problem has no solution.

In the example given, there are 2 people who make a statement that "there are at least $m$ liars" with $m>2$. Hence there must be exactly two liars (which are Person 1 and Person 4 here).

hexomino
  • 139.1k
  • 10
  • 397
  • 575