#36. 映射键值修改

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

映射键值修改

Map Modification

Background

Dawei is organizing his collection, and he has a special habit. Whenever he finds a particular item (represented by key 'a'), he always gives it to his friend Xiaoxiao (represented by key 'b'), and he no longer keeps the item himself. He hopes you can help him automate this organizing process.

Problem Description

Modify and return the given map as follows: if the key "a" has a value, set the key "b" to have that value, and set the key "a" to have the value "". Basically "b" is a bully, taking the value and replacing it with the empty string.

Input Format

The input consists of a series of key-value pairs, where each pair is composed of a string key and a string value, separated by spaces. Both keys and values are enclosed in double quotes.

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

Output Format

Output a JSON formatted string representing the modified map. Key-value pairs are separated by commas, and the entire map is enclosed in curly braces.

{"key1": "value1\