about | help | code help+videos | done | prefs |
Write a method that accepts an array of boolean and an array of integer parameters. The boolean parameters indicate if the integer parameter with the same index is supposed to be included in the sum or not. Look at the test data for further examples. As preconditions, you may assume that the two arrays have the same length. quiz2020_09_21_SLHL_includeSumArray([false, true, false], [1427, 23548, 436]) → 23548 quiz2020_09_21_SLHL_includeSumArray([false, true, true, true], [1, 2, 3, 4]) → 9 quiz2020_09_21_SLHL_includeSumArray([true, true, true, false], [5, 100, 3000, 72000]) → 3105 ...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