Very straight thought of DP, goes well in Eclipse but stuck in submit

  • -1
    public static int minDis(String w1, String w2){
    		return w2.length();
    		return w1.length();
    		return minDis(w1.substring(0, w1.length()-1),w2.substring(0, w2.length()-1));
    	return min(minDis(w1.substring(0, w1.length()-1),w2.substring(0, w2.length()-1))+1,
    			minDis(w1.substring(0, w1.length()-1),w2)+1,
    public static int min(int s1, int s2, int s3){
    	return Math.min(s1, Math.min(s2, s3));

    However, the report always says line 8: error: cannot find symbol: method minDis(String,String). When I try Run Code, given word1="", word2="", line 8 error as above but when I try in my Eclipse, it's never a problem. Anybody know what's wrong with my code? Thx!

Log in to reply

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