Question: Solving this task consists of several steps, and each next step is opened whenever the current step is solved correctly. You always have access to

Solving this task consists of several steps, and each next step is opened whenever the current step is solved correctly. You always have access to the current and all previous steps data
Your task is to implement a simple container of integer numbers As a
first step, consider implementing the following two operations
ADD should add the specified integer value to the container Returns an empty string
EXISTS should check whether the specific integer value exists in the container. Returns "true" if the value exists "false" otherwise
The container is supposed to be empty at the beginning of execution
Given a list of queries return the list of answers for these queries To pass to the next level you have to pass all tests at this level
Example
For
queries =[
["ADO","1"],
["ADO","2"].
["ADO","5"].
["ADO","2"],
["EXISTS","2"],
["EXISTS","5"].
["EXISTS","1]
["EXISTS","4"].
["EXISTS","3"],
["EXISTS","0"]
the output should be solution (queries)-("","","","","true", "true", "true", "false", "false", "false"]
Explanation
Add 1,2,5,2->[1,2,5,2]
Numbers 2,5,1 exist in the container
Numbers 4,3,0 don't exist in the container
Input/Output
[execution time limit]4 seconds (java)
(memory limit)1 GB
[input) array array string queries
An array of queries, guaranteed that all queries consist only of operations described in the description and these operations satisfy the format described in the description All integer's represents as string are from range [-100,100]

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!