We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b099e61 commit aeba0c1Copy full SHA for aeba0c1
2107-find-unique-binary-string/2107-find-unique-binary-string.js
@@ -0,0 +1,26 @@
1
+/**
2
+ * @param {string[]} nums
3
+ * @return {string}
4
+ */
5
+var findDifferentBinaryString = function(nums) {
6
+ let set = new Set(nums);
7
+ let len = nums[0].length;
8
+ let res = '';
9
+ dfs(0, [])
10
+ return res;
11
+ function dfs(start, temp) {
12
+ if (temp.length == len) {
13
+ let str = temp.join('');
14
+ if (!set.has(str)) {
15
+ res = str;
16
+ }
17
+ return;
18
19
+ for (let i = 0; i <= 1; i++) {
20
+ temp.push(i);
21
+ dfs(i, temp)
22
+ temp.pop()
23
+ if (res!='') break;
24
25
26
+};
0 commit comments