Update PeakElementFinder.java
This commit is contained in:
parent
dd251d2d33
commit
c204c4c073
|
@ -14,7 +14,7 @@ public class PeakElementFinder {
|
||||||
|
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
if (isPeak(arr, i, n)) {
|
if (isPeak(arr, i, n)) {
|
||||||
peaks.add(i);
|
peaks.add(arr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (i < n - 1 && arr[i] == arr[i + 1]) {
|
while (i < n - 1 && arr[i] == arr[i + 1]) {
|
||||||
|
|
Loading…
Reference in New Issue