Skip to content

Bug Report for string-compression #5776

@Lethairgo

Description

@Lethairgo

Bug Report for https://neetcode.io/problems/string-compression

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

Description

In Example 1, the input contains 11 "a" characters:

chars = ["a","a","a","a","a","a","a","a","a","a","a"]

The explanation says the compressed string is "a11", which is correct. However, it also says the first 3 characters of the input array should be:

["a","1","2"]

This appears to be a typo. ["a","1","2"] represents "a12", which would correspond to 12 "a" characters, not 11.

Expected Behavior

The explanation should say the first 3 characters of the input array should be:

["a","1","1"]

For example:

Input: chars = ["a","a","a","a","a","a","a","a","a","a","a"]

Output: 3

Explanation: The compressed string is "a11" and the first 3 characters of the input array should be ["a","1","1"].

Image

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