1689. Partitioning Into Minimum Number Of Deci-Binary Numbers¶ Time: $O(n)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: int minPartitions(string n) { return ranges::max(n) - '0'; } }; 1 2 3 4 5class Solution { public int minPartitions(String n) { return Character.getNumericValue(n.chars().max().getAsInt()); } } 1 2 3class Solution: def minPartitions(self, n: str) -> int: return int(max(n))