JPMorganChase interview question

Typescript flatten operator and other utility methods.