Skip to content

Commit 596e365

Browse files
authored
Create 2350. Shortest Impossible Sequence of Rolls.py
1 parent a17f3cc commit 596e365

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def shortestSequence(self, rolls: list[int], k: int) -> int:
3+
seen = set()
4+
ans = 1
5+
6+
for num in rolls:
7+
seen.add(num)
8+
9+
if len(seen) == k:
10+
ans += 1
11+
seen.clear()
12+
13+
return ans

0 commit comments

Comments
 (0)