about | help | code help+videos | done | prefs
CodingBat code practice

AP-1 > bigHeights
prev  |  next  |  chance

 (A variation on the sumHeights problem.) We have an array of heights, representing the altitude along a walking trail. Given start/end indexes into the array, return the number of "big" steps for a walk starting at the start index and ending at the end index. We'll say that step is big if it is 5 or more up or down. The start end end index will both be valid indexes into the array with start <= end.bigHeights([5, 3, 6, 7, 2], 2, 4) → 1bigHeights([5, 3, 6, 7, 2], 0, 1) → 0bigHeights([5, 3, 6, 7, 2], 0, 4) → 1...Save, Compile, Run (ctrl-enter)public int bigHeights(int[] heights, int start, int end) { } Editor font size %:75100125150Shorter output

Forget It! -- delete my code for this problem

Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph

Misc Code Practice

Difficulty: 246.2

Copyright Nick Parlante 2017 - privacy