Skip to content

Improve minimum-deletions-to-make-string-balanced to O(n) time complexity #9

@yamcodes

Description

@yamcodes

Our solution for minimum-deletions-to-make-string-balanced currently uses O(n^2) time complexity, however, we can make it use O(n) time complexity and even do it in a single sweep. There is no need to re-calculate those prefixes/suffixes every time.

Note that it might require O(n) space complexity (instead of the current O(1))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions