Showing 3 of 4 questions
You are given an inventory of colored balls, each with a value equal to its count. Determine the maximum total value you can obtain by selling a limited number of these balls, given that each sale reduces the ball's value by one.
#1. Sell Diminishing-Valued Colored Balls
Imagine people in a circle, eliminating every kth person. Determine who is the last person remaining after this process.
#2. Find the Winner of the Circular Game
Design a data structure that supports insertion, deletion, and random element retrieval, all in constant time on average. You'll need to handle edge cases carefully to achieve O(1) complexity.
#3. Insert Delete GetRandom O(1)
Page 1 of 1 · 4 total