Answered step by step
Verified Expert Solution
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
ADO
ADO
ADO
EXISTS
EXISTS
EXISTS
EXISTS
EXISTS
EXISTS
the output should be solution queries"true", "true", "true", "false", "false", "false"
Explanation
Add
Numbers exist in the container
Numbers don't exist in the container
InputOutput
execution time limit seconds java
memory limit 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started