1689. Partitioning Into Deci-Binary Numbers
Question
A decimal number is called deci-binary if each of its digits is either
0
or1
without any leading zeros. For example,101
and1100
are deci-binary, while112
and3001
are not.Given a string
n
that represents a positive decimal integer, return the minimum number of positive deci-binary numbers needed so that they sum up ton
.
Solution
遍历所有字符,返回字符串中的最大整数。
Code
1 | class Solution { |
1689. Partitioning Into Deci-Binary Numbers
https://xuanhe95.github.io/2022/06/27/1689-Partitioning-Into-Deci-Binary-Numbers/