Open
Description
The current test cases do not seem to cover inputs where the strings include the character '?', which is used as a delimiter in my submitted solution
for this input vector strs = {"what?", "really?"}; due to lack of edge test case the code passes
class Solution {
public:
string encode(vector<string>& strs) {
string tr="";
for(string s : strs){
tr=tr+s+"?";
}
return tr;
}
vector<string> decode(string s) {
vector<string> v;
string ss="";
for(char ch : s){
if(ch!='?'){
ss=ss+ch;
}
else{
v.push_back(ss);
ss="";
}
}
return v;
}
};
Metadata
Metadata
Assignees
Labels
No labels