Skip to content

Commit 035a1ef

Browse files
committed
mock files
1 parent 6bb14ca commit 035a1ef

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'''
2+
3+
'''
4+
5+
6+
class Solution:
7+
def maxDistToClosest(self, seats: List[int]) -> int:

mock/oct-2019/rotated_digits.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'''
2+
3+
X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be rotated - we cannot choose to leave it alone.
4+
5+
A number is valid if each digit remains a digit after rotation. 0, 1, and 8 rotate to themselves; 2 and 5 rotate to each other; 6 and 9 rotate to each other, and the rest of the numbers do not rotate to any other number and become invalid.
6+
7+
Now given a positive number N, how many numbers X from 1 to N are good?
8+
9+
Example:
10+
Input: 10
11+
Output: 4
12+
Explanation:
13+
There are four good numbers in the range [1, 10] : 2, 5, 6, 9.
14+
Note that 1 and 10 are not good numbers, since they remain unchanged after rotating.
15+
Note:
16+
17+
N will be in range [1, 10000].
18+
19+
'''
20+
21+
class Solution:
22+
def rotatedDigits(self, N: int) -> int:

0 commit comments

Comments
 (0)