Skip to content

Commit aaf32af

Browse files
committed
Time: 63 ms (88.89%), Space: 17.4 MB (56.4%) - LeetHub
1 parent 2f1d38c commit aaf32af

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution:
2+
def canMakeSubsequence(self, s1: str, s2: str) -> bool:
3+
j, n, m = 0, len(s1), len(s2)
4+
for i in range(n):
5+
if j < m and (ord(s2[j]) - ord(s1[i])) % 26 <= 1:
6+
j += 1
7+
return j == m

0 commit comments

Comments
 (0)