@Ignore("Remove to run test") @Test public void testDuplicatedCharacterInTheMiddleIsNotIsogram() { IsogramChecker iso = new IsogramChecker(); assertFalse(iso.isIsogram("accentor")); }
public boolean isIsogram(String phrase) { ArrayList<Integer> check = new ArrayList<>(); for (char c : phrase.toLowerCase().replace(" ", "").replace("-", "").replace(".", "").toCharArray()){ if(check.indexOf((int) c) == -1) { check.add((int) c); } else return false; } return true; }
IsogramChecker { public boolean isIsogram(String phrase) { ArrayList<Integer> check = new ArrayList<>(); for (char c : phrase.toLowerCase().replace(" ", "").replace("-", "").replace(".", "").toCharArray()){ if(check.indexOf((int) c) == -1) { check.add((int) c); } else return false; } return true; } }
IsogramChecker { public boolean isIsogram(String phrase) { ArrayList<Integer> check = new ArrayList<>(); for (char c : phrase.toLowerCase().replace(" ", "").replace("-", "").replace(".", "").toCharArray()){ if(check.indexOf((int) c) == -1) { check.add((int) c); } else return false; } return true; }  }
IsogramChecker { public boolean isIsogram(String phrase) { ArrayList<Integer> check = new ArrayList<>(); for (char c : phrase.toLowerCase().replace(" ", "").replace("-", "").replace(".", "").toCharArray()){ if(check.indexOf((int) c) == -1) { check.add((int) c); } else return false; } return true; }  boolean isIsogram(String phrase); }
IsogramChecker { public boolean isIsogram(String phrase) { ArrayList<Integer> check = new ArrayList<>(); for (char c : phrase.toLowerCase().replace(" ", "").replace("-", "").replace(".", "").toCharArray()){ if(check.indexOf((int) c) == -1) { check.add((int) c); } else return false; } return true; }  boolean isIsogram(String phrase);  }