Skip to content

Commit 5f16914

Browse files
committed
Time: 5 ms (100.00%), Space: 45.9 MB (16.45%) - LeetHub
1 parent b489136 commit 5f16914

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2825-make-string-a-subsequence-using-cyclic-increments/2825-make-string-a-subsequence-using-cyclic-increments.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ public boolean canMakeSubsequence(String str1, String str2) {
33
int i=0,j=0;
44
while(i<str1.length() && j<str2.length()){
55
char ch1 =str1.charAt(i),ch2=str2.charAt(j);
6-
if( ch1 == ch2 || ch1+1==ch2 || ch1-25==ch2){
6+
if((ch2-ch1 + 26) % 26 <= 1){
77
j++;
88
}
99
i++;

0 commit comments

Comments
 (0)