Skip to content

Commit fcad07c

Browse files
committedFeb 20, 2025
Add solution #1980
1 parent 43e1ef4 commit fcad07c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
 

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@
531531
1926|[Nearest Exit from Entrance in Maze](./1926-nearest-exit-from-entrance-in-maze.js)|Medium|
532532
1929|[Concatenation of Array](./1929-concatenation-of-array.js)|Easy|
533533
1935|[Maximum Number of Words You Can Type](./1935-maximum-number-of-words-you-can-type.js)|Easy|
534+
1980|[Find Unique Binary String](./1980-find-unique-binary-string.js)|Medium|
534535
1985|[Find the Kth Largest Integer in the Array](./1985-find-the-kth-largest-integer-in-the-array.js)|Medium|
535536
1996|[The Number of Weak Characters in the Game](./1996-the-number-of-weak-characters-in-the-game.js)|Medium|
536537
2000|[Reverse Prefix of Word](./2000-reverse-prefix-of-word.js)|Easy|
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* 1980. Find Unique Binary String
3+
* https://leetcode.com/problems/find-unique-binary-string/
4+
* Difficulty: Medium
5+
*
6+
* Given an array of strings nums containing n unique binary strings each of length n,
7+
* return a binary string of length n that does not appear in nums. If there are multiple
8+
* answers, you may return any of them.
9+
*/
10+
11+
/**
12+
* @param {string[]} nums
13+
* @return {string}
14+
*/
15+
var findDifferentBinaryString = function(nums) {
16+
return nums.map((n, i) => n[i] === '0' ? '1' : '0').join('');
17+
};

0 commit comments

Comments
 (0)
Please sign in to comment.