Dassault Systèmes Interview Question

code to flatten the array