[InterviewBit] Deserialize

Deserialize

  • Time :
  • Space :
1
2
3
4
5
6
7
8
9
10
11
vector<string> Solution::deserialize(string A) {
vector<string> res;
string now = "";
for(auto a : A) {
if(isdigit(a)) continue;
else if(a == '~') res.push_back(now), now = "";
else now.push_back(a);
}
return res;
}

Author: Song Hayoung
Link: https://songhayoung.github.io/2022/11/14/PS/interviewbit/deserialize/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.