mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 14:57:08 +00:00
Time: 670 ms (16.55%), Space: 14.6 MB (35.56%) - LeetHub
This commit is contained in:
+13
@@ -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
|
||||||
Reference in New Issue
Block a user