about | help | code help+videos | done | prefs |
Write a method that accepts an array of non-negative integers, then finds the average of all the even integers, and the average of all the odd integers. Return the positive difference between these two averages rounded to the nearest integer. The array will contain at least one number. If there is only one number in the array, or if all the numbers are even, or all the numbers are odd, return zero. runeEvenOddAdvanced2([4, 9]) → 5 runeEvenOddAdvanced2([1, 3, 6, 5, 4]) → 2 runeEvenOddAdvanced2([18]) → 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: 420
Copyright Nick Parlante 2017 - privacy