Fix a logical error

This commit is contained in:
Prasoon 2018-01-31 16:00:04 +05:30
parent 2638ce6396
commit f1200c06ce

View File

@ -19,7 +19,7 @@ import java.util.Scanner;
} }
private static int wordCount(String s){ private static int wordCount(String s){
if(s.isEmpty() || s == null) return -1; if(s.isEmpty() || s == null) return 0;
return s.trim().split("[\\s]+").length; return s.trim().split("[\\s]+").length;
} }