In this challenge, you have to establish if a positive integer is a Modest number, accordingly to the following algorithm:
Given an integer num, implement a function that returns True if num is a Modest number, or False if it's not.
is_modest(2036) ➞ True
Combination 1:
Left = 2 | Right = 036 = 36 (Leading zeros are not considered)
Number (2036) % Right (36) = 20 != Left (2)
Combination 2:
Left = 20 | Right = 36
Number (2036) % Right (36) = 20 = Left (20)
# At least a combination satisfies the condition
# It's a Modest number
is_modest(3412) ➞ False
Combination 1:
Left = 3 | Right = 412
3412 % 412 = 116 != Left
Combination 2:
Left = 34 | Right = 12
3412 % 12 = 4 != Left
Combination 3:
Left = 341 | Right = 2
3412 % 2 = 0 != Left
# It's not a Modest number
# Notice how left and right parts are made:
# They are not permutations or combinations...
# ...but partitions of consecutive digits.
is_modest(21333) ➞ True
Combination 1:
Left = 2 | Right = 1333
21333 % 1333 = 5 != Left
Combination 2:
Left = 21 | Right = 333
21333 % 333 = 21 = Left
# At least a combination satisfies the condition
# It's a Modest number
is_modest(8) ➞ False
# An integer with less than two digits can't be partitioned.