DSG Interview Question

Flatten array and sum it.