Skip to content

Commit ef2d72b

Browse files
committed
Feb 20
1 parent 24b17dc commit ef2d72b

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
class Solution:
2+
def findDifferentBinaryString(self, nums: list[str]) -> str:
3+
n = len(nums[0])
4+
nums = set(nums)
5+
for i in range(2**n):
6+
bin_str = (bin(i)[2:]).zfill(n)
7+
if bin_str not in nums:
8+
return bin_str
9+
10+
11+
def main():
12+
nums = ['01', '10']
13+
assert Solution().findDifferentBinaryString(nums) == '00'
14+
15+
nums = ['00', '01']
16+
assert Solution().findDifferentBinaryString(nums) == '10'
17+
18+
nums = ['111', '011', '001']
19+
assert Solution().findDifferentBinaryString(nums) == '000'
20+
21+
22+
if __name__ == '__main__':
23+
main()

2025-02-February-LeetCoding-Challenge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
| February 17 | [1079. Letter Tile Possibilities](https://leetcode.com/problems/letter-tile-possibilities/) | Medium | Solved |
2424
| February 18 | [2375. Construct Smallest Number From DI String](https://leetcode.com/problems/construct-smallest-number-from-di-string/) | Medium | Unsolved |
2525
| February 19 | [1415. The k-th Lexicographical String of All Happy Strings of Length n](https://leetcode.com/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/) | Medium | Unsolved |
26-
| February 20 | []() | | |
26+
| February 20 | [1980. Find Unique Binary String](https://leetcode.com/problems/find-unique-binary-string/) | Medium | Solved |
2727
| February 21 | []() | | |
2828
| February 22 | []() | | |
2929
| February 23 | []() | | |
@@ -38,5 +38,5 @@
3838
| Level | Problems | Solved | Unsolved |
3939
| --- | --- | --- | --- |
4040
| Easy | 6 | 6 | 0 |
41-
| Medium | 12 | 9 | 3 |
41+
| Medium | 13 | 10 | 3 |
4242
| Hard | 0 | 0 | 0 |

0 commit comments

Comments
 (0)