about | help | code help+videos | done | prefs |
Write a method that returns the array 'nums', but with all of the digits in the 'place' places replaced with a zero. You may NOT use strings of any kind! As a precondition, you may assume that all of the elements of 'nums' are positive. You may also assume that 'place' will be a positive power of 10 (1, 10, 100, 1000, etc.). Please note that the 'nums' array can be any length, including length zero. Look at the test data for examples. test2021_10_07_HL_zeroInPlace([], 100) → [] test2021_10_07_HL_zeroInPlace([1], 1) → [0] test2021_10_07_HL_zeroInPlace([1234987], 100) → [1234087] ...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