#43. 映射键值条件修改

    ID: 43 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatMap-1gesp1条件结构

映射键值条件修改

Modify Map

Background

In a data processing task, we need to normalize some maps storing key-value pairs. Specifically, we need to adjust the values of keys 'a' and 'b' in the map according to specific rules.

Problem Description

Modify and return the given map as follows: if exactly one of the keys "a" or "b" has a value in the map (but not both), set the other to have that same value in the map.

Input Format

Input consists of a series of key-value pair strings representing a map. For example:

"key1": "value1" "key2": "value2"

Output Format

Output the modified map, represented as a JSON-like key-value pair string. For example:

`{"key1": "value1\