about | help | code help+videos | done | prefs |
Write a method that accepts an array of positive integers calls 'nums' and a multiple called 'mult'. Return a new array with all of the multiples of 'mult' in 'nums' at the start of the array in the same order as they were in 'nums'. The end of the new array will have the numbers that are NOT multiples of 'mult' but in the reverse order compared to the original array. Look at the test data for examples. This is easier than it sounds and can be done using only one loop! mar5_2020_HL_placeIfMultiple([6], 5) → [6] mar5_2020_HL_placeIfMultiple([83], 83) → [83] mar5_2020_HL_placeIfMultiple([17, 22, 45], 11) → [22, 45, 17] ...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