Skip to content

Bug Report for string-encode-and-decode #4818

@Biplob-Gautam

Description

@Biplob-Gautam

Bug Report for https://neetcode.io/problems/string-encode-and-decode

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

The code is not wrong and it contains the (' ') (single quotes) but the compiler is saying otherwise it is also showing some error for the helper functions like readInput and all . Please fix this.

The code part
Image

The error or console part
Image

The error message
main.cpp:18:28: warning: missing terminating ' character
18 | while (s[j] != '
| ^
main.cpp:18:28: error: missing terminating ' character
main.cpp: In member function 'std::vector<std::__cxx11::basic_string > Solution::decode(std::string)':
main.cpp:20:26: error: expected primary-expression before 'readInput'
20 | std::vectorstd::string readInput() {
| ^~~~~~~~~
main.cpp:20:26: error: expected ')' before 'readInput'
main.cpp:18:19: note: to match this '('
18 | while (s[j] != '
| ^
main.cpp:20:26: error: 'readInput' was not declared in this scope
20 | std::vectorstd::string readInput() {
| ^~~~~~~~~
main.cpp:31:46: error: a function-definition is not allowed here before '{' token
31 | std::string parseInput(std::string inputStr) {
| ^
main.cpp:39:52: error: a function-definition is not allowed here before '{' token
39 | std::vectorstd::string parseArray(std::string s) {
| ^
main.cpp:75:57: error: a function-definition is not allowed here before '{' token
103 | string printListNoSpaces(std::vectorstd::string list) {
| ^
main.cpp:92:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
120 | int m...
output limit exceeded

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