Skip to content

Commit 9b940a2

Browse files
committed
3232
1 parent f6f4c4d commit 9b940a2

File tree

1 file changed

+12
-0
lines changed
  • solutions/3232. Find if Digit Game Can Be Won

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def can_alice_win(nums: list[int]) -> bool:
2+
nums.sort()
3+
set_nums = 0
4+
for i, num in enumerate(nums):
5+
if num > 9:
6+
return True if set_nums != sum(nums[i:]) else False
7+
else:
8+
set_nums += num
9+
return True
10+
11+
12+
print(can_alice_win([3, 3, 7, 9, 4, 55, 9, 9, 13, 7, 9, 8]))

0 commit comments

Comments
 (0)