Given distinct binary strings of length , construct any binary string of length that does not appear in the list.
You are given an array of distinct binary strings, where each string has length . Your task is to return any binary string of length that is not present in the array.
A binary string contains only the characters 0 and 1. Because the input list contains unique strings of length , it is guaranteed that at least one valid answer exists.
This is a constructive problem: you do not need to find the lexicographically smallest answer, only any missing binary string is acceptable.
0 and 1.0 or 1.Note: The core guarantee is that a missing string always exists.
Example 1
Input
nums = ["01","10"]
Output
"11"
Explanation
There are four binary strings of length 2: 00, 01, 10, and 11. Since 11 is not in the list, it is a valid answer.
Example 2
Input
nums = ["111","011","001"]
Output
"010"
Explanation
Any binary string of length 3 that is not one of the three inputs is acceptable. Here, 010 is missing.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.