clean javascript solution


  • 0
    3
    var isSubsequence = function(s, t) {
        var count = 0;
        for(var i = 0; i<t.length; i++){
            if(s[count] == t[i]){
                count++;
            }
        }
        if(count == s.length){
            return true;
        }
        else return false;
    };
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.