IBM interview question

Write a method to flatten and re-arrange a json structure.