Skip to content

Commit c51848e

Browse files
authored
Create sum-of-digits-in-the-minimum-number.py
1 parent 1c03297 commit c51848e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Time: O(n * l)
2+
# Space: O(l)
3+
4+
class Solution(object):
5+
def sumOfDigits(self, A):
6+
"""
7+
:type A: List[int]
8+
:rtype: int
9+
"""
10+
total = sum([int(c) for c in str(min(A))])
11+
return 1 if total % 2 == 0 else 0

0 commit comments

Comments
 (0)