about | help | code help+videos | done | prefs |
Write a method that returns the sum of the integers in array 'nums', except that only numbers that are multiples of 'mult' count towards the sum. Look at the test data for examples. As preconditions you may assume there are no negative numbers in 'nums' and that 'mult' is positive. test2022_01_20_APSLHL_sumMultiples([], 15) → 0 test2022_01_20_APSLHL_sumMultiples([], 2) → 0 test2022_01_20_APSLHL_sumMultiples([22, 11, 33, 55, 42, 64, 121, 222], 11) → 242 ...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