Ctrl K

Nine Digits From Three Multiples

Easy
You are given a three-digit number num. Write num, then 2 * num, then 3 * num one after another with no separators, forming a single string of digits. Return True if every digit from 1 to 9 appears in that string exactly once and there is no zero at all. Otherwise return False. For instance, num = 219 produces 219438657, which qualifies.
Example 1
num=273 → True

Gluing 273, 546 and 819 gives 273546819: each digit from 1 to 9 exactly once.

Example 2
num=250 → False

The result is 250500750, which has zeros and repeats.

Example 3
num=111 → False

111222333 uses only three distinct digits.

Constraints
  • 100 ≤ num ≤ 999
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsValue of a Roman Numeral EasyDigit Squares Down to One EasyThe Lost Ticket EasyEven Piles of Cards EasyMost Crowded Digit-Sum Groups Easy
loading Python…
Input
num=273
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 63 tests on the server, hidden ones included.