思想:基本程序设计
public boolean isLongPressedName(String name, String typed) { if(name.equals(typed)) return true; for (int i = 0, j = 0; i < name.length();) { try { if (name.charAt(i) == typed.charAt(j)) { j++; i++; continue; } else if (name.charAt(i - 1) == typed.charAt(j)) { j++; continue; } else { return false; } } catch (Exception e) { return false; } } return true; }