Construct Binary Tree from Preorder and Inorder Traversal
Construct a binary tree from preorder and inorder traversal sequences.
Copy List with Random Pointer
Create a deep copy of a linked list where each node has a random pointer
Minimum Window Substring
Find the minimum window substring that contains all characters of another string
Single Number
Find the single number that appears once in an array where every other number appears twice.
Smallest Substring with All Characters
Find the smallest substring that contains all characters of a given pattern
Sort Characters by Frequency
Sort characters in string by frequency using heap or bucket sort
Task Scheduler
Find the minimum number of intervals the CPU will take to finish all given tasks with a cooldown period between identical tasks
Top K Frequent Elements (LC 347) — Bucket Sort + Heap
Solve LeetCode 347 Top K Frequent Elements (Medium) with frequency map + bucket sort O(n) or min-heap O(n log k). Step-by-step for interviews.
Two Sum
Find two numbers in an array that add up to a target value.
Two Sum
Given an array of integers and a target, return indices of two numbers that add up to the target.
Vertical Order Traversal of Binary Tree
Traverse a binary tree vertically and return nodes by columns