From 0f0eab02ea17656961eb558bb75de216c3e331ea Mon Sep 17 00:00:00 2001 From: jihyup-byun Date: Sun, 11 Oct 2026 05:25:28 +0000 Subject: [PATCH] 2350 --- ... Shortest Impossible Sequence of Rolls.py" | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 "leetcode3/\353\263\200\354\247\200\355\230\221/v3/2350. Shortest Impossible Sequence of Rolls.py" diff --git "a/leetcode3/\353\263\200\354\247\200\355\230\221/v3/2350. Shortest Impossible Sequence of Rolls.py" "b/leetcode3/\353\263\200\354\247\200\355\230\221/v3/2350. Shortest Impossible Sequence of Rolls.py" new file mode 100644 index 00000000..07472c05 --- /dev/null +++ "b/leetcode3/\353\263\200\354\247\200\355\230\221/v3/2350. Shortest Impossible Sequence of Rolls.py" @@ -0,0 +1,26 @@ +''' +실패 +''' +from collections import defaultdict + +class Solution: + def shortestSequence(self, rolls: list[int], k: int) -> int: + st = set() + for roll in rolls: + for s in list(st): + st.add(s+(roll,)) + st.add((roll,)) + + dic = defaultdict(int) + + for s in list(st): + dic[len(s)] += 1 + # print(dic[1]) + # print(dic[2]) + # print(dic[3]) + + num =1 + while True: + if not dic[num] == k ** num: + return num + num += 1