Johnson Controls Interview Question

How to flatten a nested list ??