diff --git a/08_greedy_algorithms/java/01_set_covering/src/SetCovering.java b/08_greedy_algorithms/java/01_set_covering/src/SetCovering.java index 86f07910..9afd2c82 100644 --- a/08_greedy_algorithms/java/01_set_covering/src/SetCovering.java +++ b/08_greedy_algorithms/java/01_set_covering/src/SetCovering.java @@ -25,13 +25,13 @@ public static void main(String[] args) { bestStation = station.getKey(); statesCovered = covered; } - statesNeeded.removeIf(statesCovered::contains); + } + statesNeeded.removeIf(statesCovered::contains); - if (bestStation != null) { - finalStations.add(bestStation); - } + if (bestStation != null) { + finalStations.add(bestStation); } } System.out.println(finalStations); // [ktwo, kone, kthree, kfive] } -} \ No newline at end of file +}