NeetCode Comprehensive Algorithm Bank & Offline Handbook
Synchronized bilingual toggle with dual NeetCode & LeetCode problem numbering and direct links. Features step-by-step logic, benchmark Python3 code, complexity analysis, interview pitfalls, and standalone offline exports.
Partition Equal Subset Sum (分割等和子集)
Given a non-empty array nums of positive integers, return whether it can be partitioned into two subsets with equal sums. Constrai...
Triangle (三角形最小路径和)
Given a triangle array, return the minimum path sum from the top to the bottom, where each step moves to an adjacent number in the...
Delete and Earn (删除并获得点数)
You are given an integer array nums. You may delete elements, earning points equal to the value deleted, but deleting a value x al...
Filling Bookcase Shelves (填充书架)
Books must be placed in order on shelves of width shelfWidth. Each book has a thickness and a height; the height of a shelf is the...
Combination Sum IV (组合总和 IV)
Given an array of distinct positive integers nums and a target, return the number of ordered sequences whose elements sum to targe...
Perfect Squares (完全平方数)
Given an integer n, return the fewest number of perfect squares whose sum equals n. A perfect square is k * k for some integer k. ...
Check if There is a Valid Partition For The Array (检查数组是否存在有效划分)
Given a 0-indexed integer array nums, a partition into contiguous subarrays is valid when every subarray is one of: length 2 with ...
Maximum Subarray Min-Product (子数组最小乘积的最大值)
The min-product of a subarray is its minimum value multiplied by its sum. Given an array nums, return the maximum min-product over...
Minimum Cost For Tickets (最低票价)
You are given days, the days of the year on which you travel, and costs = [cost1, cost7, cost30] for 1-day, 7-day, and 30-day pass...
Integer Break (整数拆分)
Given an integer n, break it into the sum of at least two positive integers and maximise the product of those integers. Return the...
Number of Longest Increasing Subsequence (最长递增子序列的个数)
Given an integer array nums, return the number of longest strictly increasing subsequences. Constraints: 1 <= nums.length <=...
Russian Doll Envelopes (俄罗斯套娃信封问题)
You are given a 2-D array envelopes of [width, height] pairs. An envelope can be placed inside another only if both its width and ...
Stickers to Spell Word (贴纸拼词)
Given an array of stickers (each a string of lowercase letters) and a target string, return the minimum number of stickers needed ...
Uncrossed Lines (不相交的线)
You are given two integer arrays nums1 and nums2. Draw connecting lines between equal values, preserving order, so that no two lin...
Solving Questions With Brainpower (解决智力问题)
You are given a 2-D array questions where questions[i] = [points_i, brainpower_i]. Solving question i earns points_i but forces yo...
Count Ways To Build Good Strings (统计构造好字符串的方案数)
Given low, high, zero, and one, build strings by appending either zero copies of the character zero or one copies of the character...
Ugly Number II (丑数 II)
An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5. Given n, return the n-th ugly number. Constra...
New 21 Game (新 21 点)
Starting with 0 points, repeatedly draw an integer uniformly from [1, maxPts] and add it, stopping as soon as the score reaches k ...
Best Team With No Conflicts (无矛盾的最佳球队)
You are given integer arrays scores and ages. A team is conflict-free when no younger player has a strictly higher score. Return t...
Longest String Chain (最长字符串链)
Given an array of words, a word chain is a sequence where each word is a predecessor of the next, meaning the next word can be for...
Knight Dialer (骑士拨号器)
A chess knight dials phone numbers on a keypad shaped like a 3 x 4 grid holding the digits 0-9 (the bottom-left and bottom-right c...
Partition Array for Maximum Sum (分隔数组以得到最大和)
Given an integer array arr and an integer k, partition arr into contiguous subarrays each of length at most k. Every element of a ...
Largest Divisible Subset (最大整除子集)
Given a set of distinct positive integers nums, return the largest subset in which every pair (a, b) satisfies a % b == 0 or b % a...
Count Strictly Increasing Subarrays (统计严格递增子数组的数目)
Given an integer array nums, return the number of contiguous subarrays that are strictly increasing. Constraints: 1 <= nums.len...