Question: You are given a text in JSON format in the form of a string consisting of small and capital English alphabets, curly brackets, double inverted

You are given a text in JSON format in the form of a string consisting of small and capital English alphabets, curly brackets, double inverted commas, commas, and no spaces present anywhere.
You are also given Q queries, where each query consists of a key of the given JSON object in the form of a string. For each query, you have to print the value of that key.
Input
The first line of the input consists of the s
- the JSON string (7<=|S|<=103)
. The second line of input consists of a single integer Q
(1<=Q<=103)
the total number of queries. Each of the following Q
lines consist of a string t
- the key to be queried.
Output
The output should consist of Q
lines - in the ith
line the value corresponding to the ith
query should be printed.
Example
input
"Student":{"Name":"John","Age":"15"},"Class":"10"
3
Student.Name
Student.Age
Class
output
John
15
10
c++ full code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!