- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubseq.cpp
More file actions
Latest commit
24 lines (16 loc) · 389 Bytes
/
Copy pathsubseq.cpp
File metadata and controls
24 lines (16 loc) · 389 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<iostream>
usingnamespacestd;
voidseparateString(string s, string ans){
if(s.length() == 0) {
cout << ans << endl;
return;
}
int code = s[0];
separateString(s.substr(1), ans);
separateString(s.substr(1), ans + s[0]);
separateString(s.substr(1), ans + to_string(code));
}
intmain() {
separateString("AB", "");
return0;
}