Implement O(1) randomized multiset | TikTok Interview Question