Update core-java-modules/core-java-arrays-operations-advanced-2/src/main/java/com/baeldung/equilibriumindex/EquilibriumIndexFinder.java

Co-authored-by: KevinGilmore <kpg102@gmail.com>
This commit is contained in:
thibaultfaure 2024-02-04 08:14:25 +01:00 committed by GitHub
parent 6e83e84cd6
commit d88aa573b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class EquilibriumIndexFinder {
List<Integer> findEquilibriumIndexes(int[] array) {
int[] partialSums = new int[array.length + 1];
partialSums[0] = 0;
for (int i=0; i<array.length; i++) {
for (int i = 0; i < array.length; i++) {
partialSums[i+1] = partialSums[i] + array[i];
}