-
Couldn't load subscription status.
- Fork 379
Closed
Description
LeetCode Username
ayan_9819
Problem Number, Title, and Link
https://leetcode.com/problems/is-subsequence/submissions/1799570608
Bug Category
Problem description
Bug Description
- Is Subsequence
Language Used for Code
None
Code used for Submit/Run operation
class Solution {
public boolean isSubsequence(String s, String t) {
int n = s.length() , m = t.length();
if(n > m ) return false;
int i =0 , j = 0;
while( i < n && j < m){
if(s.charAt(i) == t.charAt(j)){
i++ ; j++;
}
else{
j++;
}
}
return i==n;
}
}Expected behavior
Runtime
1 ms
Beats 93.00%
Screenshots
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels