🚀 NeetCode 973 Algorithm HandbookBlind 75 · NC 150 · NC 25019 Core Categories

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.

Mastery Progress
0.0%(0/973)
● Mastered: 0
◐ Reviewing: 0
○ Unstarted: 973
🔍
🎯 Featured Lists
📂 Categories (19 Core Topics)
Diff:
Mastery:
Showing 24 problems
NeetCode #97LC-791Arrays & Hashing
Medium

Custom Sort String (自定义字符串排序)

You are given two strings order and s. Reorder s so that its characters follow order's ordering; characters not in order are place...

View Solution→
NeetCode #98LC-347Arrays & HashingBlind 75NC 150NC 250
Medium

Top K Frequent Elements (前 K 个高频元素)

Given an integer array nums and an integer k, return the k most frequent elements in any order. Constraints: 1 <= nums.length &...

View Solution→
NeetCode #99LC-271Arrays & HashingBlind 75NC 150NC 250NC Algo100
Medium

Encode and Decode Strings (字符串的编码与解码)

Design an algorithm to encode a list of strings into a single string, and decode that string back into the original list. The inpu...

View Solution→
NeetCode #100LC-304Arrays & HashingNC 250
Medium

Range Sum Query 2D - Immutable (二维区域和检索 - 矩阵不可变)

Design a data structure that answers rectangle-sum queries on an immutable 2D matrix. Implement NumMatrix(matrix) and sumRegion(ro...

View Solution→
NeetCode #101LC-1152Arrays & Hashing
Medium

Analyze User Website Visit Pattern (用户网站访问行为分析)

Given arrays username, timestamp and website describing visits, find the pattern (an ordered triple of websites) visited by the mo...

View Solution→
NeetCode #102LC-238Arrays & HashingBlind 75NC 150NC 250
Medium

Product of Array Except Self (除自身以外数组的乘积)

Given an integer array nums, return an array answer where answer[i] is the product of all elements of nums except nums[i]. Constra...

View Solution→
NeetCode #103LC-1769Arrays & Hashing
Medium

Minimum Number of Operations to Move All Balls to Each Box (移动所有球到每个盒子所需的最小操作数)

You have n boxes given as a binary string boxes, where boxes[i] == '1' means box i contains a ball. In one operation you may move ...

View Solution→
NeetCode #104LC-36Arrays & HashingNC 150NC 250
Medium

Valid Sudoku (有效的数独)

Determine whether a partially filled 9x9 Sudoku board is valid. Only the filled cells need to be validated, against three rules: e...

View Solution→
NeetCode #105LC-128Arrays & HashingBlind 75NC 150NC 250
Medium

Longest Consecutive Sequence (最长连续序列)

Given an unsorted array of integers nums, return the length of the longest run of consecutive integers. The elements need not be a...

View Solution→
NeetCode #106LC-535Arrays & Hashing
Medium

Encode and Decode TinyURL (TinyURL 的加密与解密)

Design a class that encodes a long URL into a short URL and decodes it back. There is no restriction on how the encoding works, as...

View Solution→
NeetCode #107LC-554Arrays & Hashing
Medium

Brick Wall (砖墙)

There is a rectangular brick wall made of rows of bricks of varying widths but the same height. Draw a vertical line from the top ...

View Solution→
NeetCode #108LC-122Arrays & HashingNC 250
Medium

Best Time to Buy and Sell Stock II (买卖股票的最佳时机 II)

You are given an array prices where prices[i] is the price of a stock on day i. You may complete as many transactions as you like ...

View Solution→
NeetCode #109LC-229Arrays & HashingNC 250
Medium

Majority Element II (多数元素 II)

Given an integer array nums of size n, find all elements that appear more than n / 3 times. Constraints: 1 <= n <= 5 * 10^4,...

View Solution→
NeetCode #110LC-2780Arrays & Hashing
Medium

Minimum Index of a Valid Split (合法分割的最小下标)

An element is dominant if it appears more than half the time in an array. Given nums with a dominant element, find the minimum ind...

View Solution→
NeetCode #111LC-560Arrays & HashingNC 250
Medium

Subarray Sum Equals K (和为 K 的子数组)

Given an array of integers nums and an integer k, return the total number of contiguous subarrays whose sum equals k. Constraints:...

View Solution→
NeetCode #112LC-974Arrays & Hashing
Medium

Subarray Sums Divisible by K (和可被 K 整除的子数组)

Given an integer array nums and an integer k, return the number of non-empty subarrays whose sum is divisible by k. Constraints: 1...

View Solution→
NeetCode #113LC-1590Arrays & Hashing
Medium

Make Sum Divisible by P (使数组和能被 P 整除)

Given an array of positive integers nums and an integer p, remove the shortest subarray (possibly empty) so that the sum of the re...

View Solution→
NeetCode #114LC-1930Arrays & Hashing
Medium

Unique Length-3 Palindromic Subsequences (长度为 3 的不同回文子序列)

Given a string s, return the number of unique palindromic subsequences of length 3. A subsequence is formed by deleting characters...

View Solution→
NeetCode #115LC-1524Arrays & Hashing
Medium

Number of Sub-arrays With Odd Sum (和为奇数的子数组数目)

Given an array of integers arr, return the number of subarrays with an odd sum. The answer may be large, so return it modulo 10^9 ...

View Solution→
NeetCode #116LC-1963Arrays & Hashing
Medium

Minimum Number of Swaps to Make the String Balanced (使字符串平衡的最少交换次数)

Given a 0-indexed string s of even length consisting of [ and ], return the minimum number of swaps (of any two indices) needed to...

View Solution→
NeetCode #117LC-2001Arrays & Hashing
Medium

Number of Pairs of Interchangeable Rectangles (可互换矩形的组数)

You are given n rectangles, each [width_i, height_i]. Two rectangles are interchangeable if their width-to-height ratios are equal...

View Solution→
NeetCode #118LC-2002Arrays & Hashing
Medium

Maximum Product of the Length of Two Palindromic Subsequences (两个回文子序列长度的最大乘积)

Given a string s, find two disjoint palindromic subsequences of s and return the maximum product of their lengths. If no two disjo...

View Solution→
NeetCode #119LC-2017Arrays & Hashing
Medium

Grid Game (网格游戏)

Two robots play on a 2 x n grid. Robot 1 starts at (0, 0) and moves only right; it may drop to row 1 at any column, after which it...

View Solution→
NeetCode #120LC-438Arrays & Hashing
Medium

Find All Anagrams in a String (找到字符串中所有字母异位词)

Given two strings s and p, return all start indices of p's anagrams in s. Constraints: 1 <= s.length, p.length <= 3 * 10^4, ...

View Solution→