Coding Interview Problems
339. Nested List Weight Sum
Problem Statement This problem gives you a nested list of integers called nestedList, where each element is represented by the...
378. Kth Smallest Element in a Sorted Matrix
At first glance, this problem looks like a simple sorting task, but the real learning begins when you try to...
560. Subarray Sum Equals K
Problem Statement You’re given an integer array nums and an integer k. Your task is to count how many contiguous,...
236. Lowest Common Ancestor of a Binary Tree
Problem Statement You’re given the root of a binary tree and two distinct nodes p and q that are guaranteed...
198. House Robber
The House Robber problem is a classic introduction to Dynamic Programming. It is a favorite among interviewers at companies like...
110. Balanced Binary Tree
Checking if a tree is balanced is a fundamental skill frequently tested by giants like Google, Meta, and Amazon. It...
55. Jump Game
Problem Statement You’re given an array nums where nums[i] tells you the farthest you’re allowed to jump forward from index i. Starting at index $0$, determine...
64. Minimum Path Sum
Problem Statement You are given an m x n grid of non-negative integers. Starting at the top-left cell (0, 0),...
20. Valid Parentheses
Problem Statement You are given a string s that contains only the characters '(', ')', '{', '}', '[', and ']',...
26. Remove Duplicates from Sorted Array
Removing duplicates from a sorted array is a fundamental array-manipulation problem frequently asked in interviews at companies like Google and...
300. Longest Increasing Subsequence
The Longest Increasing Subsequence (LIS) problem is a classic interview question frequently asked by top companies like Google, Amazon, and...
2327. Number of People Aware of a Secret
This is a Dynamic Programming problem that focuses on "states" and "time intervals." It simulates a growth process where individuals...