Skip to content

Bug Report for reverse-string #4280

Open
@zibdie

Description

@zibdie

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

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

class Solution:
    def reverseString(self, s: List[str]) -> None:
        """
        Do not return anything, modify s in-place instead.
        """
        l, r = 0, len(s) - 1
        while l < r:
            s[l], s[r] = s[r], s[l]
            l += 1
            r -= 1
Input: s=["t", "a", "p", "i", "q"]
Your Output: ["q","\"",","," ","\"","t"]
Output: ["q","\"",","," ","\"","t"]

Notice one of the values in the output in the array: "\""

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