Skip to content

Instantly share code, notes, and snippets.

@ThanawatMas
Created May 20, 2018 15:07
Show Gist options
  • Save ThanawatMas/8040a8c2c378e7cd657948ba694565f8 to your computer and use it in GitHub Desktop.
Save ThanawatMas/8040a8c2c378e7cd657948ba694565f8 to your computer and use it in GitHub Desktop.
SolveByInnosense.java
public class SolveByInnosense extends ConcurrentModificationSolution {
@Override
public void addItemAndReIndex(List<String> roundList, String newItem) {
for (String item : roundList) {
if (item.equals(newItem)) {
roundList.remove(item);
roundList.add(0, newItem);
}
}
}
@Override
public String solutionName() {
return "Innosense";
}
public static void main(String[] args) {
SolveByInnosense innosense = new SolveByInnosense();
innosense.solve();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment