Company: Oracle_19aug
Difficulty: medium
JSON Diff Tool 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. Examples Example 1: Input: json1 = '{"name":"Alex","age":25,"city":"New York"}' json2 = '{"name":"Alex","age":30,"city":"Los Angeles","country":"USA"}' Output: ["age", "city"] Explanation: The "age" and "city" keys have different values. The "country" key does not appear in both JSONs. Return the sorted list ["age", "city"]. Function Description Complete the function getJSONDiff in the editor with the following parameter(s): json1 : the first JSON string json2 : the second JSON