Skip to content

[BUG] - 383. Ransom Note - incorrect space complexity #22955

@jbulin

Description

@jbulin

LeetCode Username

jbulin

Problem Number, Title, and Link

  1. Ransom Note https://leetcode.com/explore/learn/card/the-leetcode-beginners-guide/692/challenge-problems/4427/

Bug Category

Editorial

Bug Description

In the video solution, space complexity is computed incorrectly as O(k) which for k=26 is O(1). That would mean that for any input, the algorithm only uses constant memory. However, the size of the dictionary depends on log n.

Language Used for Code

None

Code used for Submit/Run operation

No response

Expected behavior

The space complexity should be, for example, O(k log n).

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