Skip to content

Commit 8c83023

Browse files
Create 2864.py
1 parent 485358e commit 8c83023

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

2501-3000/2864.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution:
2+
def maximumOddBinaryNumber(self, s: str) -> str:
3+
n = s.count("1")-1
4+
ans = "1"*n
5+
ans += "0"*(len(s)-n-1)
6+
ans += "1"
7+
return ans

0 commit comments

Comments
 (0)