Find Unique Binary String

Given an array of strings nums containing n unique binary strings, where each string has length n, return a binary string of length n that does not appear in nums.

If there are multiple valid answers, you may return any of them.

Example 1
Inputnums = ["01","10"]
Output"11"
"11" does not appear in nums, and "00" would also be correct.
Example 2
Inputnums = ["00","01"]
Output"11"
"11" does not appear in nums, and "10" would also be correct.

Constraints

  • n == nums.length
  • 1 <= n <= 16
  • nums[i].length == n
  • nums[i] is either '0' or '1'.
  • All the strings of nums are unique.

Asked at 5 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate