diff --git a/src/main/java/uta/cse3310/Leaderboard.java b/src/main/java/uta/cse3310/Leaderboard.java index 5c7a096..4c22c50 100644 --- a/src/main/java/uta/cse3310/Leaderboard.java +++ b/src/main/java/uta/cse3310/Leaderboard.java @@ -32,8 +32,9 @@ public void update(String handle, int score) { int new_score = score + LB.get(handle); LB.put(handle, new_score); - scores.remove(score); - names.remove(handle); + int i = names.indexOf(handle); + names.remove(i); + scores.remove(i); scores.add(new_score); Collections.sort(scores); if(scores.indexOf(new_score) >= names.size())