AlgoUniversity
  • Go Back
Discussion
JSON Parsing :

Author

Yash Sahijwani

Difficulty Level : Medium

Submissions : 157

Asked In : Sprinklr

Marks :10

: 0 | : 1

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 \leq |S| \leq 10^3)$$$ . The second line of input consists of a single integer $$$Q$$$ $$$(1 \leq Q \leq 10^3)$$$ 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 $$$i^{th}$$$ line the value corresponding to the $$$i^{th}$$$ query should be printed.

Example

Input
"Student":{"Name":"John","Age":"15"},"Class":"10"
3
Student.Name
Student.Age
Class
Output
John
15
10

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.