static int lCommonPrefix(S a, S b) { int i = 0; while (i < a.length() && i < b.length() && a.charAt(i) == b.charAt(i)) ++i; ret i; }