https://leetcode.com/problems/find-if-digit-game-can-be-won/description/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
class Solution:
def canAliceWin(self, nums: List[int]) -> bool:
sum_single, sum_double = 0, 0
for num in nums:
if num < 10 :
sum_single += num
else:
sum_double += num
if sum_single == sum_double:
return False
else:
return True
|
cs |
한 자리수 숫자의 합
두자리수 숫자의합을 비교
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 3210. Find the Encrypted String (0) | 2024.09.23 |
---|---|
3194. Minimum Average of Smallest and Largest Elements (0) | 2024.09.21 |
3285. Find Indices of Stable Mountains (0) | 2024.09.21 |
3190. Find Minimum Operations to Make All Elements Divisible by Three (0) | 2024.09.19 |
leetcode 3280. Convert Date to Binary (1) | 2024.09.12 |
댓글