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:35 +01:00 committed by GitHub
parent d88aa573b0
commit 9aca65bd33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

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