Nov 24, 2025
Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range...
leetcodealgorithmeasyjavatreebstdfsproblem-solving
Nov 24, 2025
A string can be abbreviated by replacing any number of non-adjacent, non-empty substrings with their lengths. The lengths should not have leading zeros.
leetcodealgorithmeasyjavastringtwo-pointersproblem-solving
Nov 24, 2025
You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them.
leetcodealgorithmeasyjavastringstacktwo-pointersproblem-solving
Nov 24, 2025
Welcome to the String Processing template collection! These are ready-to-use Java snippets for the core string patterns: sliding window, two pointers, string matching, manipulation, and parsing. If you already know...
leetcodetemplatesstring
Nov 24, 2025
Queues are one of the most versatile data structures in algorithm problems. This page collects ready-to-use Java templates for every queue variant you’ll encounter on LeetCode — from the basic...
leetcodetemplatesqueue
Nov 24, 2025
This page collects ready-to-use Java templates for bit manipulation, fast exponentiation, GCD/LCM, prime sieves, and basic number theory. Each snippet is self-contained — copy it into your solution and adapt...
leetcodetemplatesmathbit-manipulation
Nov 24, 2025
This page collects battle-tested Java templates for every major linked-list pattern you’ll see on LeetCode. Each section includes ready-to-use code, the signal phrases that tell you which pattern to reach...
leetcodetemplateslinked-list
Nov 24, 2025
Depth-First Search (DFS) is one of the most fundamental graph traversal algorithms. It works by starting at a node and exploring as far down each branch as possible before backtracking...
leetcodetemplatesdfsgraph
Nov 24, 2025
Data structure design problems are among the most popular interview questions at top tech companies. This page provides complete, tested Java implementations for LRU/LFU cache, Trie, time-based key-value store, and...
leetcodetemplatesdesign
Nov 24, 2025
Breadth-First Search (BFS) is a graph traversal algorithm that explores nodes layer by layer, visiting all neighbors at the current depth before moving deeper. It’s the go-to technique for finding...
leetcodetemplatesbfsgraph