Short Java Solution - Two Lines


  • -1
    class Solution {
        public int strStr(String haystack, String needle) {
            int index = haystack.indexOf(needle);
            return index;
        }
    }    
    

Log in to reply
 

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