about | help | code help+videos | done | prefs |
Write a method that returns an "encrypted" version of the integer array 'nums'. Each element of the array is to be encrypted by adding the value of 'offset' plus the array index to each array element. After doing that, the result is to be divided by 'cycle'. The remainder of that operation is the new "encrypted" value for that array element. Return an array containing all of these new "encrypted" values. As preconditions, you may assume that all elements in the array and 'offset' are non-negative. You may assume that 'cycle' is positive. (NO! "positive" and "non-negative" are NOT the same thing! You should know this by now!!!) Look at the test data for examples. NOTE: You are NOT allowed to use maps, functional programming, strings, or array lists. You are NOT allowed to have any nested loops or nested recursion. You are NOT allowed to make a giant array that is way longer than the input parameter arrays. Kyle, you must resist your natural impulses! test2021_06_03_SL_hashCode([], 7, 2) → [] test2021_06_03_SL_hashCode([4275], 71, 13) → [28] test2021_06_03_SL_hashCode([10000], 100, 0) → [0] ...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: 250
Copyright Nick Parlante 2017 - privacy