Sankey Solutions Interview Question

Solve a nested array and make it a normal array