Skip to content
Prev Previous commit
Next Next commit
Update Solution.java
  • Loading branch information
javadev authored Dec 21, 2023
commit 578e787b9f8a21e07cbe762b52ba402597f43a2c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ public int minOperations(List<Integer> nums, int k) {
}
int fin = -1;
for (Pair pair : visited) {
if (pair != null && !pair.isVisited) {
return -1;
} else if (pair != null) {
if (pair != null) {
fin = Math.max(fin, pair.totalVisitedTillNow);
}
}
Expand Down