mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 03:27:07 +00:00
13 lines
347 B
Python
13 lines
347 B
Python
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 |