SpanIdea Interview Question

Calculate sum of array using generator.