PayPal interview question

Input: A string like {"a":"1", "b":"2","a":"foo"} Output: A JSON string: {"a":["1","foo"], "b":"2"}

Interview Answer

Anonymous

Nov 5, 2017

use HashTable> outputJson to store the result. Store the input json in HashTable. If the value exists in outputJson, then append this value to linklist in existing json. else create a new link list and add it to output json

1