Definition at line 5 of file main.cpp.
◆ isSubsequence()
| bool Solution::isSubsequence |
( |
string |
s, |
|
|
string |
t |
|
) |
| |
|
inline |
Definition at line 8 of file main.cpp.
9 {
10 if ((int)s.size() == 0)
11 return true;
12
13 int index = 0;
14 for (char c: t)
15 {
16 if (c == s[index])
17 {
18 index++;
19 if (index == (int)s.size())
20 return true;
21 }
22 }
23 return false;
24 }
Referenced by main().
The documentation for this class was generated from the following file: