3 lines JAVA code


  • 0
    Y

    public class Solution {
    public int strStr(String haystack, String needle) {
    if(needle.length()==0) return 0;
    int pos = haystack.toLowerCase().indexOf(needle.toLowerCase());
    return pos;
    }
    }


Log in to reply
 

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