Skip to content

heirsdilemma

bradendubois edited this page Jun 9, 2021 · 6 revisions

Heir's Dilemma

ID: heirsdilemma

Difficulty: 1.7

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, a basic Python solution can achieve the solution in time. A comprehension (or loop), enumerate through each value in [L, H] and ensure that "0" is not in the string representation of the value, that the length of the number (as a string) is the same as the size of the string representation turned into a set (ensuring no duplicate values), and that the number module any of its digits is equal to zero.

Clone this wiki locally