Time: 670 ms (16.55%), Space: 14.6 MB (35.56%) - LeetHub

This commit is contained in:
Deven
2022-09-19 14:00:26 -04:00
parent 53efe34019
commit 4c1757e544
@@ -0,0 +1,13 @@
class Solution(object):
def minPartitions(self, n):
"""
:type n: str
:rtype: int
"""
largestDigit = 0
for d in n:
if int(d) > largestDigit:
largestDigit = int(d)
if largestDigit == 9:
return largestDigit
return largestDigit