Skip to content

Commit

Permalink
Updated "Java Dequeue" problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
RodneyShag committed May 28, 2018
1 parent bf26fc6 commit e188524
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Java/Data Structures/Java Dequeue/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public static void main(String[] args) {
map.merge(num, 1, Integer::sum);

max = Math.max(max, map.size());

/* If all integers are unique, we have found our largest
possible answer, so we can break out of loop */
if (max == m) {
break;
}
}

scan.close();
Expand Down

0 comments on commit e188524

Please sign in to comment.