Flattens the given list of nested lists.
Array: Location of the list to flatten
Output-location: Location to store the output data