Skip to content

Commit 0719b92

Browse files
authored
Update Solution.java
1 parent b43603c commit 0719b92

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost

1 file changed

+2
-2
lines changed

src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost/Solution.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public int minimumCost(String target, String[] words, int[] costs) {
8787
int e = pair.get(1);
8888
dm.putIfAbsent(e, new HashMap<>());
8989
Map<Integer, Integer> qm = dm.get(e);
90-
qm.put(b, qm.getOrDefault(b, Integer.MAX_VALUE));
91-
qm.put(b, Math.min(qm.get(b), costs[i]));
90+
int value = qm.getOrDefault(b, Integer.MAX_VALUE));
91+
qm.put(b, Math.min(value, costs[i]));
9292
}
9393
}
9494
}

0 commit comments

Comments
 (0)