Interview Round DistributionClick any round below to filter
Topics:
Showing 20 of 101 results for Digit InsurancePage 1 of 6
Coding
48
Vertical Order Traversal
Perform a vertical order traversal of a binary tree.
Input: root = [1,2,3,4,5,6,7]
Output: [[4],[2],[1,5,6],[3],[7]]
Explanation: Traverses the tree maintaining column indices, seamlessly grouping nodes that share the exact same vertical alignment.
Validate if a given tree is a valid binary search tree.
Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key, and the right subtree contains only nodes with keys greater than the node's key…
Merge a New Interval
Merge a new interval into a list of non-overlapping intervals.
Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]
Output: [[1,2],[3,10],[12,16]]
Explanation: The new interval overlaps with [3,5], [6,7], and [8,10], merging them all into the unified block [3,10].
Find the shortest distance from all buildings to an empty land in a grid.
You are given a grid of values 0, 1, or 2, where 0 is empty land, 1 is a building, and 2 is an obstacle. Find the shortest travel distance from all buildings to an empty land spot.
Input: grid = [[1,0],[0,1]]
Output: 2
Explanation: The empty lands are at (0,1) a…
Iterator over a Binary Search Tree
Implement an iterator over a binary search tree.
Input: root = [7,3,15,null,null,9,20], calls: next(), hasNext(), next()
Output: 3, TRUE, 7
Explanation: The iterator yields the smallest value (3), confirms more nodes exist, then properly yields the next in-order value (7).
Buildings with an Ocean View
Find all buildings that have an ocean view.
Input: heights = [1,2,3,4]
Output: [3]
Explanation: Since the ocean is to the right, only the rightmost tallest building (index 3) is not blocked by any others.
Add Two Numbers Represented as Strings
Add two non-negative integers represented as strings.
Input: num1 = "456", num2 = "77"
Output: "533"
Explanation: Performs character-by-character addition from right to left, carrying the 1 from 6+7=13 to the next decimal place.