Skip to content

Commit a623281

Browse files
authored
Create partitioning-into-minimum-number-of-deci-binary-numbers.cpp
1 parent 239e91a commit a623281

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Time: O(n)
2+
// Space: O(1)
3+
4+
class Solution {
5+
public:
6+
int minPartitions(string n) {
7+
return *max_element(cbegin(n), cend(n)) - '0';
8+
}
9+
};

0 commit comments

Comments
 (0)