Nov 24, 2025
Welcome to the backtracking templates! Backtracking is one of the most versatile problem-solving techniques in competitive programming—once you learn the core pattern, you can tackle a huge family of problems...
leetcodetemplatesbacktracking
Nov 24, 2025
Welcome to the Array & Matrix template collection! These are ready-to-use Java snippets for the most common array patterns: two pointers, sliding window, prefix sum, binary search, and matrix operations....
leetcodetemplatesarraymatrix
Nov 20, 2025
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
leetcodealgorithmmediumjavadfsgraphmatrixproblem-solving
Nov 18, 2025
Given an array of integers arr, sort the array by performing a series of pancake flips.
leetcodealgorithmmediumjavaarraysortingproblem-solving
Nov 18, 2025
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
leetcodealgorithmmediumjavastringhash-tableproblem-solving
Nov 18, 2025
You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].
leetcodealgorithmmediumjavaarraygreedyproblem-solving
Nov 18, 2025
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two...
leetcodealgorithmmediumjavalinked-listrecursionproblem-solving
Nov 18, 2025
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. The only constraint stopping you from robbing each of...
leetcodealgorithmmediumjavadynamic-programmingdpproblem-solving
Nov 18, 2025
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1....
leetcodealgorithmeasyjavadynamic-programmingrecursionproblem-solving
Nov 18, 2025
Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head.
leetcodealgorithmeasyjavalinked-listiterationproblem-solving