leet-code/partitioning-into-minimum-n.../sol.rs

7 lines
144 B
Rust

impl Solution {
pub fn min_partitions(n: String) -> i32 {
(n.bytes()
.max()
.unwrap() - b'0') as i32
}
}