mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
38 lines
1.6 KiB
HTML
38 lines
1.6 KiB
HTML
<p>Given an array of strings <code>nums</code> containing <code>n</code> <strong>unique</strong> binary strings each of length <code>n</code>, return <em>a binary string of length </em><code>n</code><em> that <strong>does not appear</strong> in </em><code>nums</code><em>. If there are multiple answers, you may return <strong>any</strong> of them</em>.</p>
|
|
|
|
<p> </p>
|
|
<p><strong>Example 1:</strong></p>
|
|
|
|
<pre>
|
|
<strong>Input:</strong> nums = ["01","10"]
|
|
<strong>Output:</strong> "11"
|
|
<strong>Explanation:</strong> "11" does not appear in nums. "00" would also be correct.
|
|
</pre>
|
|
|
|
<p><strong>Example 2:</strong></p>
|
|
|
|
<pre>
|
|
<strong>Input:</strong> nums = ["00","01"]
|
|
<strong>Output:</strong> "11"
|
|
<strong>Explanation:</strong> "11" does not appear in nums. "10" would also be correct.
|
|
</pre>
|
|
|
|
<p><strong>Example 3:</strong></p>
|
|
|
|
<pre>
|
|
<strong>Input:</strong> nums = ["111","011","001"]
|
|
<strong>Output:</strong> "101"
|
|
<strong>Explanation:</strong> "101" does not appear in nums. "000", "010", "100", and "110" would also be correct.
|
|
</pre>
|
|
|
|
<p> </p>
|
|
<p><strong>Constraints:</strong></p>
|
|
|
|
<ul>
|
|
<li><code>n == nums.length</code></li>
|
|
<li><code>1 <= n <= 16</code></li>
|
|
<li><code>nums[i].length == n</code></li>
|
|
<li><code>nums[i] </code>is either <code>'0'</code> or <code>'1'</code>.</li>
|
|
<li>All the strings of <code>nums</code> are <strong>unique</strong>.</li>
|
|
</ul>
|