NVIDIA Interview Question

flatten list to sum in python