This site uses JavaScript for navigation, themes, and games like 2048. Please enable JavaScript in your browser settings, then reload the page.
8 problems. Click one to open the details.
0/8 solved
1.Next Permutation
Rearrange nums into the next lexicographical permutation.
2.3Sum
Find all unique triplets that sum to zero.
3.Kadane's Algorithm
Maximum subarray sum in O(n).
4.Majority Element II
Elements appearing more than floor(n/3) times.
5.Count Subarrays with XOR K
Prefix XOR + hashmap count of subarrays with XOR k.
6.Repeating and Missing Number
Find the duplicate and missing value in 1..n.
7.Count Inversions
Count pairs i<j with a[i]>a[j] via merge sort.
8.Maximum Product Subarray
Max product of a contiguous subarray.