Skip to content

Commit b112e94

Browse files
committed
Time: 41 ms (39.01%), Space: 16.6 MB (45.47%) - LeetHub
1 parent a4879c1 commit b112e94

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from collections import Counter
2+
3+
4+
class Solution:
5+
def maximumOddBinaryNumber(self, s: str) -> str:
6+
return '1' * (s.count('1') - 1) + '0' * (len(s) - s.count('1')) + '1'
7+
8+
9+
s = "010"
10+
print(Solution().maximumOddBinaryNumber(s))

0 commit comments

Comments
 (0)