Skip to content

Incorrect editorial - 1980. Find Unique Binary String #27268

@przemek3d88

Description

@przemek3d88

LeetCode Username

przemysaw2

Problem Number, Title, and Link

  1. Find Unique Binary String https://leetcode.com/problems/find-unique-binary-string

Bug Category

Editorial

Bug Description

The space complexity of the first approach is incorrect. It should be $O(n^2)$, not $O(n)$ as you store the strings of length $n$.

The same applies to this sentence: "Additionally, we will convertnumsto a hash set prior to starting the recursion, so we can have checks in $O(1)$ time complexity in the base case."

It is also incorrect as the check takes $O(n)$ due to the size of the string. And the whole algorithm also take $O(n^2)$ as you check each of $n$ strings and every check is $O(n)$. However, the time complexity is correct, just parts of the explanation are incorrect.

Language Used for Code

None

Code used for Submit/Run operation

Expected behavior

Correct space complexity and explanations in approach 1.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions