Java indexOf()


  • 0
    T
        for(int j=-1, i=0; i<s.length(); i++)
        {
            j = t.indexOf(s.charAt(i), j+1);
            if(j==-1) return false;
        }
        return true;

Log in to reply
 

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