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

 

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

Write a method that accepts an array of integers called 'nums' and a 'low' and 'high' value. Return a new array containing only the numbers in 'nums' that fall between 'low' and 'high' inclusive. Keep the original order for the numbers that fall in the range of 'low' to 'high'. The new array must only be long enough to hold the numbers that were in the range.


cedarInRange([], 1, 100) → []
cedarInRange([-50, -40, -51, -48, -53], -10, 10) → []
cedarInRange([4, 2, 5, 142, 42, 248, 453, 902], 12, 800) → [142, 42, 248, 453]

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

public int[] cedarInRange(int[] nums, int low, int high) { }

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: 280 Post-solution available

Copyright Nick Parlante 2017 - privacy