Examples
Input: (["add", "add", "add", "random", "delete", "random"], [5, 10, 5, 2, 5, 1])
Expected Output: [True, True, False, 5, True, 10]
Explanation: After inserting 5, 10, and 5, the internal slots are [5, 10, 5]. random(2) returns slots[2] = 5. delete(5) removes the most recently inserted remaining 5, leaving [5, 10]. random(1) then returns 10.
Input: (["add", "add", "add", "delete", "random", "add", "random"], [1, 2, 1, 2, 1, 3, 4])
Expected Output: [True, True, False, True, 1, True, 1]
Explanation: Deleting 2 removes it from the middle, so the last 1 is swapped into its slot. The structure becomes [1, 1], so random(1) returns 1. After adding 3, random(4) uses 4 % 3 = 1, which is still 1.
Input: (["delete", "random", "add", "add", "random", "delete", "random", "delete", "random"], [7, 0, -1, -1, 3, -1, 0, -1, 5])
Expected Output: [False, None, True, False, -1, True, -1, True, None]
Explanation: This checks edge cases: deleting a missing value, calling random on an empty collection, handling duplicates, and storing negative numbers.
Input: (["add", "add", "add", "add", "add", "delete", "delete", "random", "delete", "random"], [1, 2, 1, 3, 1, 2, 3, 2, 1, 1])
Expected Output: [True, True, False, True, False, True, True, 1, True, 1]
Explanation: After deleting 2, the newest 1 is swapped forward, which means the per-value position list for 1 is no longer sorted by slot index. A correct O(1) solution must still update bookkeeping properly when deleting 1 later.