Implement solve(data, mode) using Python's json module:
"serialize" → convert the Python dict/list data to a JSON string (keys sorted alphabetically)."parse" → parse the JSON string data and return the Python object."roundtrip" → serialize then immediately parse data and return the result (should equal the input).Examples
solve({"name": "Alice", "age": 30}, "serialize") → '{"age": 30, "name": "Alice"}'solve('{"name": "Alice", "age": 30}', "parse") → {"name": "Alice", "age": 30}Sample tests