Jan 5, 2026
Given an integer array nums and an integer k, return the kth largest element in the array.
leetcodemediumarrayheapquickselectdivide-and-conquer
Jan 5, 2026
Welcome to the Heap templates page! Here you’ll find battle-tested Java snippets for every common heap (priority queue) pattern on LeetCode — from basic min/max heaps to advanced techniques like...
leetcodetemplatesheappriority-queue
Jan 4, 2026
Given an integer array nums, find the subarray with the largest sum, and return its sum.
leetcodemediumarraydynamic-programminggreedydivide-and-conquer
Jan 4, 2026
A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative....
leetcodemediumarraydynamic-programminggreedy
Jan 4, 2026
You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the i-th row and colSum[j] is the sum of the...
leetcodemediumarraymatrixgreedy
Jan 4, 2026
Given a string s and an integer k, return true if you can use all the characters in s to construct k palindrome strings or false otherwise.
leetcodemediumstringgreedyhash-table
Jan 4, 2026
You are given two strings s1 and s2 of equal length consisting of only letters 'x' and 'y'.
leetcodemediumstringmathgreedy
Jan 4, 2026
A company is planning to interview 2n people. Given the array costs where costs[i] = [aCosti, bCosti], the cost of flying the i-th person to city a is aCosti, and...
leetcodemediumarraygreedysorting
Jan 4, 2026
There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.
leetcodehardarraygreedy
Jan 4, 2026
You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]:
leetcodeeasyarraygreedysorting