Back to problems

Add, Remove, and Find Values in a Bounded Integer Universe

Algorithm · Amazon · Easy

You are asked to build an integer set that processes a sequence of commands on a universe whose size is given ahead of time. The universe consists of all integers v with 0 bool[]. The operations argument is an array of two‑element string tuples. Each tuple holds an action code ("ADD", "REMOVE", or "CONTAINS") followed by a decimal string that encodes the integer value. The set starts empty. For every operation in the input, you must record its outcome according to the rules…

Checking your access…