Sum of Array

Easy
7 views 25 Jan 2026
Given n integers, print their sum....

Maximum Element

Easy
4 views 25 Jan 2026
Print the maximum value in the array....

Reverse the Array

Easy
8 views 25 Jan 2026
Print the array in reverse order....

Count Occurrences

Easy
7 views 25 Jan 2026
Given n numbers and x, count how many times x appears....

Concatenate Two Arrays

Easy
6 views 25 Jan 2026
Given two arrays, print them concatenated....

Remove Duplicates (Keep Order)

Medium
6 views 25 Jan 2026
Remove duplicates but keep the first time each value appears....

Rotate Array Right

Medium
4 views 25 Jan 2026
Rotate an array to the right by k positions....

Range Sum Queries

Medium
5 views 25 Jan 2026
Answer q range-sum queries on an array....

Two Sum Indices

Medium
4 views 25 Jan 2026
Find indices i and j such that a[i]+a[j]=target. Print first pair found, else -1 -1....

Sort by Frequency

Medium
5 views 25 Jan 2026
Sort array values by frequency (desc), and by value (asc) when tie....

Intersection (Unique Sorted)

Medium
8 views 25 Jan 2026
Given two arrays, print unique common values in increasing order....

Missing Number 1..N

Medium
5 views 25 Jan 2026
You get n-1 numbers from 1..n. Find the missing number....

Longest Subarray Sum = K

Hard
6 views 25 Jan 2026
Given n integers and k, find the longest subarray with sum exactly k....

Maximum Subarray Sum

Hard
5 views 25 Jan 2026
Print the maximum subarray sum (Kadane)....

Count Inversions

Hard
6 views 25 Jan 2026
Count pairs i a[j]....

Sliding Window Maximum

Hard
6 views 25 Jan 2026
Given array and window size k, print the maximum in each window....

Minimum Swaps to Sort

Hard
6 views 25 Jan 2026
Given a permutation of 1..n, print minimum swaps to sort it....

Kth Smallest (Quickselect)

Hard
5 views 25 Jan 2026
Find the k-th smallest value in the array (1-based k)....

Split into 3 Equal Sum Parts

Hard
6 views 25 Jan 2026
Check if the array can be split into three contiguous parts with equal sum. Print YES or NO....

Largest Rectangle in Histogram

Hard
5 views 25 Jan 2026
Given bar heights, find the largest rectangle area in the histogram....