We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Test cases does not have any string in which '?' is there so when I am only using a delimiter as '?' the solution is getting ACCEPTED
I have pasted my code here which is getting accepted rather it should fail for cases where '?' is present in string.
string encode(vector& strs) { string s=""; for(string ch : strs){ s+=ch; s.push_back('?'); } return s; }
vector<string> decode(string s) { vector<string>v; string str=""; for(char ch : s){ if(ch=='?'){ v.push_back(str); str=""; continue; } str.push_back(ch); } if(str!="") v.push_back(str); return v;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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.
Test cases does not have any string in which '?' is there so when I am only using a delimiter as '?' the solution is getting ACCEPTED
I have pasted my code here which is getting accepted rather it should fail for cases where '?' is present in string.
string encode(vector& strs) {
string s="";
for(string ch : strs){
s+=ch;
s.push_back('?');
}
return s;
}
The text was updated successfully, but these errors were encountered: