Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Let A and B be two events in a sample space with A B. Then, A B = .

Answered: 1 week ago

Question

5.6 Describe alternatives to recruitment?

Answered: 1 week ago

Question

5.4 Identify external recruitment sources.

Answered: 1 week ago