12 lines
307 B
Go
12 lines
307 B
Go
// Package q1689 implements a solution for https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/
|
|
package q1689
|
|
|
|
func minPartitions(n string) int {
|
|
maxDigit := 0
|
|
for i := range len(n) {
|
|
maxDigit = max(maxDigit, int(n[i]-'0'))
|
|
}
|
|
return maxDigit
|
|
}
|
|
|
|
var _ = minPartitions
|