BonAmi Software Interview Question

Write code to flatten nested list