about | help | code help+videos | done | prefs |
Write a method that returns the number of elements in the integer array 'nums' that are multiples of 'mult'. For example, in the array {3,12,17,33,5,1,9} there are 4 elements that are multiples of 3. So, for that array, if 'mult' was 3, you would return 4. As a precondition, you may assume that 'mult' is greater than or equal to 1. Note that all numbers are considered multiples of 1. practice2023_10_20_countMults([-8, -200, -40, -6], 2) → 4 practice2023_10_20_countMults([5, 10, 15, 20, 25, 30, 35, 40], 5) → 8 practice2023_10_20_countMults([5, 10, 15, 20, 25, 30, 35, 40], 10) → 4 ...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: 220
Copyright Nick Parlante 2017 - privacy