Qm
BrainteasersJane StreetSIG

The number that describes its own digits

Find a ten-digit number with the following property: its first digit is the number of zeros in the number, its second digit is the number of ones, its third digit is the number of twos, and so on, up to its tenth digit, which is the number of nines.

Find such a number and argue that it is the only one.

Show a hint

The ten digits count the ten digit-types, so they add up to 10. That forces most of them to be small. Start by showing that large digits like 8 and 9 cannot appear, then work down.

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

A sentence nobody on the island can sayThe number equal to the sum of the cubes of its digitsThe number that rotates when multipliedThe number that equals the sum of the factorials of its digitsFive statements counting their own falsehoods
All questions →