Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def rotatedDigits(self, N: int) -> int:
- rotations = {
- 0: 0,
- 1: 1,
- 8: 8,
- 2: 5,
- 5: 2,
- 6: 9,
- 9: 6,
- }
- count = 0
- for i in range(N, 1):
- try:
- rotations[i]
- count += 1
- except KeyError:
- continue
- return count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement