We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4915e78 + 13a6ee2 commit 6f2766eCopy full SHA for 6f2766e
12
@@ -0,0 +1,36 @@
1
+class Solution {
2
+ public:
3
+ bool stringStack(string &pat, string &tar) {
4
+ // code here
5
+ int n= pat.size();
6
+ int m= tar.size();
7
+
8
+ int i=n-1;
9
+ int j=m-1;
10
+ int count =0;
11
+ while (i>=0 && j>=0){
12
13
+ if (pat[i]==tar[j]){
14
+ if (count%2==0) {
15
+ j--;
16
+ count=0;
17
+ i--;
18
+ }
19
+ else{
20
21
+ count++;
22
23
24
25
26
27
28
29
30
31
32
+ if (j<0) return true;
33
+ else return false;
34
35
+};
36
0 commit comments