Company: Microsoft_10july
Difficulty: medium
JSON Difference Problem Description Develop a simple service to compare two JSON (JavaScript Object Notation) objects and identify differences in their key-value pairs. To keep the prototype straightforward: Each JSON object will contain only key-value pairs (no nested objects or arrays). Given two JSON strings, json1 and json2 , determine the list of keys where the values differ. Ignore keys that appear in only one of the JSON objects. The output should be a list of differing keys, sorted in alphabetical order. Complete the function getJSONDiff in the editor with the following parameter(s): json1 : the first JSON string json2 : the second JSON string Returns string[] : a sorted list of keys that have different associated values in the two JSONs Examples Example 1: Input: json1 = '{"name":"Alex","age":"25","city":"NewYork"}', json2 = '{"name":"Alex","age":"30","city":"LosAngeles","country":"USA"}' Output: ["age", "city"] Explanation: The "age" and "city" keys have different values. The