def check(x):
a=0
b=0
while x>0:
a=a+1
if b<x%10:
b=x%10
x=x//10
return[a,b]
for i in range(1000000):
a = check(i)
if a[0] == 3 and a[1] == 5: print(i)
ответ: 555
def check(x):
a=0
b=0
while x>0:
a=a+1
if b<x%10:
b=x%10
x=x//10
return[a,b]
for i in range(1000000):
a = check(i)
if a[0] == 3 and a[1] == 5: print(i)
ответ: 555