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

 

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

Write a method that has an input array 'nums' and a string 'shift'. The string 'shift' is used to indicate how to change each value in 'nums'. For each "<" in 'shift' reduce each number in 'nums' by one. For each ">" in 'shift' increase each number in 'nums' by one. Any other characters in 'shift' are ignored. Look at the test data for examples. Note that either the array or the string or both could be empty.


mar7_2016_SLHL_shiftNums([], "<<<<<") → []
mar7_2016_SLHL_shiftNums([], "") → []
mar7_2016_SLHL_shiftNums([5], "afsdfdsfw>asfdas>") → [7]

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

public int[] mar7_2016_SLHL_shiftNums(int[] nums, String shift) { }

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: 290

Copyright Nick Parlante 2017 - privacy