about | help | code help+videos | done | prefs |
Mountain, Part III: Given an array of ints (nums) public int getPeakIndex(int[] arrayp) ---- Returns the index of the first peak (local maximum) in the array, if it exists; otherwise -1. getPeakIndex([11, 22, 33, 22, 11]) → 2 getPeakIndex([11, 22, 11, 22, 11]) → 1 getPeakIndex([11, 22, 33, 55, 77]) → -1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 325
Copyright Nick Parlante 2017 - privacy