Showing 3 of 163 questions
Transform a binary tree so that the original left-most leaf becomes the new root. The original root becomes a left child, and the original right child becomes the right child of the original root's parent.
#1. Binary Tree Upside Down
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.
#2. Insert Delete GetRandom O(1)
You're given a nested list of integers where each integer has a depth. Calculate the weighted sum of all integers, where the weight is the depth of the integer from the bottom of the nested structure.
#3. Nested List Weight Sum II
Page 1 of 1 · 163 total