Created
May 20, 2018 15:09
-
-
Save ThanawatMas/28c93920e9e56e5dfd1ea6a8ba4d7010 to your computer and use it in GitHub Desktop.
SolveBySomeSense.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SolveBySomeSense 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); | |
break; | |
} | |
} | |
} | |
@Override | |
public String solutionName() { | |
return "SomeSense"; | |
} | |
public static void main(String[] args) { | |
SolveBySomeSense someSense = new SolveBySomeSense(); | |
someSense.solve(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment