id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > chronicLargestJump
prev  |  next  |  chance

Write a method that accepts an integer array and returns the largest positive "jump" between two consecutive numbers in the array. For example, the array {5,3,17,20,1} has a positive jump from 3 to 17 of 14, a positive jump from 17 to 20 of 3, and all other jumps are negative. So for this array, a value of 14 would be returned because it is the greatest positive jump. If there are no positive jumps, return zero.


chronicLargestJump([5, 3, 17, 20, 1]) → 14
chronicLargestJump([]) → 0
chronicLargestJump([5]) → 0

...Save, Compile, Run (ctrl-enter)

public int chronicLargestJump(int[] nums) { }

Editor font size %:
Shorter 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

Java Help

Misc Code Practice

Difficulty: 295

Copyright Nick Parlante 2017 - privacy