Nov 5, 2025
The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean...
leetcodealgorithmhardcpparraysmultisetsliding-windowtwo-heapsproblem-solving
Nov 5, 2025
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right....
leetcodealgorithmhardcpparraysdequesliding-windowmonotonic-queueproblem-solving
Nov 5, 2025
Given a binary array nums, return the maximum number of consecutive 1’s in the array.
leetcodealgorithmeasycpparrayssliding-windowproblem-solving
Nov 5, 2025
Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:
leetcodealgorithmmediumcpparraystwo-pointerssortingproblem-solving
Oct 29, 2025
Trees are one of the most frequently tested data structures in coding interviews. This page collects ready-to-use C++ templates for every major tree pattern — from basic traversals to advanced...
leetcodetemplatestrees
Oct 29, 2025
Minimal, copy-paste Python for combinatorics (nCk mod P) and 2D geometry primitives (cross product, point on segment).
leetcodetemplatesmathgeometry
Oct 29, 2025
Graph algorithms are among the most versatile tools in competitive programming and coding interviews. A graph is simply a collection of nodes (vertices) connected by edges, and nearly every “network,”...
leetcodetemplatesgraph
Oct 29, 2025
Dynamic Programming is the most common pattern in LeetCode Medium/Hard problems. If you only learn one advanced technique, make it DP.
leetcodetemplatesdynamic-programming
Oct 29, 2025
This page is your toolbox of essential data structures for LeetCode. Each template is self-contained C++ you can copy directly into your solution. They range from beginner-friendly (binary search, prefix...
leetcodetemplatesdata-structuresalgorithms
Oct 29, 2025
Arrays and strings are the foundation of coding interviews — you’ll encounter them in nearly every problem set. This page provides battle-tested Python templates for the most important patterns: sliding...
leetcodetemplatesarraysstrings