python-algorithm
leetcode 1689. Partitioning Into Minimum Number Of Deci-Binary Numbers
무적김두칠
2023. 1. 26. 08:31
https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/description/
Partitioning Into Minimum Number Of Deci-Binary Numbers - LeetCode
Partitioning Into Minimum Number Of Deci-Binary Numbers - A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not. Given a string n that
leetcode.com
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.
반응형