Company: Microsoft_10july
Difficulty: medium
JSON Difference Problem Description A configuration service stores settings as flat JSON objects: every object is just a set of key-value pairs, with no nested objects and no arrays. When a setting is rolled out, the service has to report which settings actually changed between the old configuration and the new one. You are given two such JSON strings, json1 and json2 . Report every key that appears in both objects but whose associated values are not identical . A key that appears in only one of the two objects is not a change and must be ignored. Function Complete the function getJSONDiff in the editor. json1 : the first JSON string json2 : the second JSON string It returns the list of keys whose values differ, sorted in ascending order. Input Format The first line contains json1 . The second line contains json2 . Each line holds one complete JSON object. Read each object as a whole line, because a quoted value may contain space characters. Output Format Print the differing keys, one