about | help | code help+videos | done | prefs |
Two non-negative integers have the same "parity" if both are even, or if both are odd. Return true if all the numbers in an array have the same parity. For example, in the array {4, 7, 0, 19}, there is a mix of evens and odds, and so you would return false. sameParity([4, 7, 0, 19]) → false sameParity([0, 10, 2, 16, 8]) → true sameParity([11, 13, 999]) → 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: 200
Copyright Nick Parlante 2017 - privacy