about | help | code help+videos | done | prefs |
Write a method that finds the "vampire sum" of an array of numbers. Vampires like to avoid certain numbers at certain times. Given an array of integers called 'num' and a number to avoid called 'avoid', find the sum of all the integers in 'num' but do not include any occurrence of 'avoid'. oct31_2019_P1SLHL_vampireSum([4, 4, 6, 7, 1, -3, 4], 1) → 22 oct31_2019_P1SLHL_vampireSum([4, 4, 6, 7, 1, -3, 4], 4) → 11 oct31_2019_P1SLHL_vampireSum([7, 1, -5, -3, 2, 2, 2, 2, 5, 7, -14, -1, 3], 2) → 0 ...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