Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(n):
- s = []
- while n > 0:
- s.append(n % 16)
- n //= 16
- s = s[::-1]
- return s
- count = 0
- for i in range(100, 1000):
- n = f(i)
- s = n
- n.sort()
- n = n[::-1]
- if s == n:
- count += 1
- for i in range(10000, 100000):
- n = f(i)
- s = n
- n.sort()
- n = n[::-1]
- if s == n:
- count += 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment