JPMorganChase interview question

Write a function to flatten a dict