Skip to content

Latest commit

 

History

History
8 lines (7 loc) · 526 Bytes

File metadata and controls

8 lines (7 loc) · 526 Bytes

Given a list of integers, find the sum of all even integers that are either prime or divisible by 3. Return the sum. If there are no such numbers, return 0. An even number is considered prime if it has no divisors other than 1 and itself.

For example:

  • sumOfEvenSpecial([2, 4, 6, 7, 11, 13])8 (2 is even and prime, 6 is even and divisible by 3)
  • sumOfEvenSpecial([10, 14, 15, 22, 2, 12])14 (2 and 12 are even and special)
  • sumOfEvenSpecial([4, 6, 8, 12])18 (6 and 12 are even and divisible by 3)