Leetcode 1980 - Find Unique Binary String

題目

Problem#

給你 $n$ 個 binary string nums,其中每個 string 長度 $n$,要你回傳沒有出現在 nums 裏頭的 binary string。

測資限制#

  • $1 \le n \le 16$

想法#

Naive: 把 num 建成 dict,$n$ 很小,可以直接暴力枚舉 $[1, 2^n]$ 。

AC Code#

  • 時間複雜度: $\mathcal{O}(2^n)$
  • 空間複雜度: $\mathcal{O}(2^n)$