Flatten a Multi-Dimensional Array | AlgoML Prep