Jan 20, 2026
Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.
leetcodemediumarray
Jan 20, 2026
This page collects ready-to-use C++ templates for every major binary search pattern you’ll encounter on LeetCode — from basic sorted-array lookup to rotated arrays, 2D matrices, and “search on the...
leetcodetemplatessearchbinary-search
Jan 20, 2026
Given an integer array nums and two integers lower and upper, return the number of range sums that lie in [lower, upper] inclusive.
leetcodehardarraydivide-and-conquer
Jan 19, 2026
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
leetcodemediumtreedfs
Jan 19, 2026
Design a data structure that supports adding new words and finding if a string matches any previously added string.
leetcodemediumstringdesigntrie
Jan 19, 2026
There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrival_i, time_i]:
leetcodemediumarraysimulation
Jan 19, 2026
You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated...
leetcodeeasyarrayhash-tablemath
Jan 19, 2026
Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters.
leetcodeeasystringhash-tablegreedy
Jan 19, 2026
Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1.
leetcodeeasystringhash-table
Jan 19, 2026
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any order....
leetcodeeasyarrayhash-table