about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy