about | help | code help+videos | done | prefs |
apcsaArraysMoreEvens
Given an array of ints, return true if the array contains more elements with even values and false otherwise (same # of even and odd values, or more odd values). HINTYou can use the remainder operator % to find even and odd values. 5 % 2 == 1, 6 % 2 == 0. (Also -3 % 1 == -1, which you need to watch out for) apcsaArraysMoreEvens([1, 2, 3, 4]) → false apcsaArraysMoreEvens([1, 2, 3, 4, 5]) → false apcsaArraysMoreEvens([-1, 0, 0]) → true ...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