https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/description/
1
2
3
|
class Solution:
def minPartitions(self, n: str) -> int:
return max(list(map(int, list(n))))
|
cs |
자리 수 중에서 가장 큰 수를 return 하면 됩니다.
Just return the largest number among the digits.
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2545. Sort the Students by Their Kth Score (0) | 2023.01.27 |
---|---|
leetcode 2396. Strictly Palindromic Number (0) | 2023.01.27 |
codeforces 50A - Domino piling (0) | 2023.01.25 |
codeforces 1772A - A+B? (0) | 2023.01.25 |
codeforces 1760A - Medium Number (0) | 2023.01.25 |
댓글