Are the Sum of Digits in the Numbers Equal?

Published by Matt in

Write a function that takes an array of two numbers and determines if the sum of the digits in each number are equal to each other.

Examples

is_equal([105, 42]) ➞ true
# 1 + 0 + 5 = 6
# 4 + 2 = 6

is_equal([21, 35]) ➞ false

is_equal([0, 0]) ➞ true

Notes

N/A

Watch a quick demo on how Edabit works.