diff --git a/leetcode_java/src/main/java/LeetCodeJava/String/FindAndReplaceInString.java b/leetcode_java/src/main/java/LeetCodeJava/String/FindAndReplaceInString.java index e5a2f3e3..84f3181b 100644 --- a/leetcode_java/src/main/java/LeetCodeJava/String/FindAndReplaceInString.java +++ b/leetcode_java/src/main/java/LeetCodeJava/String/FindAndReplaceInString.java @@ -105,6 +105,8 @@ public String findReplaceString_0_1(String s, int[] indices, String[] sources, S * * update index with replacement string length * + * -> NOTE !!! we use "source" length (with replacementIndex) + * (but NOT target length) */ i += sources[replacementIndex].length(); // Skip the replaced substring } else {