Sum of List

Easy
2 views 24 Jan 2026
Read n integers. Output the sum....

Min and Max

Easy
4 views 24 Jan 2026
Read n integers. Output minimum and maximum in one line....

Reverse List

Easy
3 views 24 Jan 2026
Read n integers. Output them in reverse order....

Count Positives

Easy
2 views 24 Jan 2026
Read n integers. Count how many are > 0 and output count....

Find First Index

Easy
2 views 24 Jan 2026
Read n integers and a target x. Output the first index (0-based) where x appears, else -1....

Remove All Occurrences

Easy
2 views 24 Jan 2026
Read n integers and value x. Remove all x and output remaining numbers. If nothing left output EMPTY....

Stack Operations

Easy
3 views 24 Jan 2026
Read q commands: PUSH x or POP. Start empty list. POP on empty does nothing. At end output size and last element (or EMPTY)....

Concatenate Two Lists

Easy
3 views 24 Jan 2026
Read two lists A and B. Output concatenated list A followed by B....

Check Sorted

Easy
2 views 24 Jan 2026
Read n integers. Output YES if list is non-decreasing else NO....

Adjacent Sums

Easy
2 views 24 Jan 2026
Read n integers. Build a new list of size n-1 where b[i]=a[i]+a[i+1]. Output b (or EMPTY if n...

Rotate List Right

Medium
3 views 24 Jan 2026
Read n integers and k. Rotate list to the right by k positions and output....

Prefix Sum Queries

Medium
3 views 24 Jan 2026
Read n integers and q queries l r (1-based). Output sum of each range....

Two Sum Exists

Medium
2 views 24 Jan 2026
Read n integers and target T. Output YES if there exist i...

Run Length of Numbers

Medium
3 views 24 Jan 2026
Read n integers. Compress as pairs value count for consecutive equal values. Output pairs in new lines....

Remove Duplicates Keep Order

Medium
3 views 24 Jan 2026
Read n integers. Remove duplicates but keep first occurrence order. Output the new list....

Second Largest Distinct (Lists)

Medium
3 views 24 Jan 2026
Read n integers. Output the second largest distinct value, or NONE if not exists....

Longest Consecutive Ones

Medium
6 views 24 Jan 2026
Read n bits (0/1). Compute longest consecutive 1s length....

Subarray Sum Positive

Medium
3 views 24 Jan 2026
Read n positive integers and target S. Output YES if there exists a subarray with sum exactly S else NO....

Sort By Frequency

Medium
2 views 24 Jan 2026
Read n integers. Sort them by frequency ascending, if tie by value ascending. Output sorted list....

Move Zeros To End

Medium
2 views 24 Jan 2026
Read n integers. Move all zeros to end keeping order of non-zeros. Output result....

Partition Around Pivot

Medium
2 views 24 Jan 2026
Read n integers and pivot x. Output list such that all x. Keep relative order inside each group....

Transpose Matrix

Medium
3 views 24 Jan 2026
Read r and c and then matrix. Output transpose matrix (c rows each has r numbers)....

Spiral Print Matrix

Medium
2 views 24 Jan 2026
Read r and c and a matrix. Output elements in spiral order....

Majority Element

Medium
2 views 24 Jan 2026
Read n integers. If an element appears more than n/2 times, output it else output NONE....

Kth Smallest Quickselect

Medium
5 views 24 Jan 2026
Read n integers and k (1-based). Compute kth smallest element using quickselect style and output it....

LIS Length

Hard
3 views 24 Jan 2026
Read n integers. Output length of longest increasing subsequence....

Sliding Window Maximum

Hard
3 views 24 Jan 2026
Read n integers and window size k. For each window output maximum. Use deque logic....

Largest Rectangle Histogram

Hard
3 views 24 Jan 2026
Read n bar heights. Compute the largest rectangle area in histogram and output it....

Trapping Rain Water

Hard
6 views 24 Jan 2026
Read n heights. Water trapped between bars should be calculated and printed....

Subarrays Sum Divisible

Hard
3 views 24 Jan 2026
Read n integers and k. Count subarrays whose sum is divisible by k....

Minimum Jumps

Hard
3 views 24 Jan 2026
Read n integers where a[i] is max jump length from i. Output minimum jumps from 0 to n-1 or -1 if not possible....

Count Pairs With Difference K

Hard
3 views 24 Jan 2026
Read n integers and integer k. Count number of pairs (i...

Split Array Largest Sum

Hard
5 views 24 Jan 2026
Read n integers and m parts. Split array into m non-empty continuous parts to minimize the maximum part sum. Output that minimum possible value....

Maximum Subarray Sum Circular

Hard
3 views 24 Jan 2026
Read n integers (can be negative). Compute maximum subarray sum in circular array and output it....

Top K Frequent Elements

Hard
4 views 24 Jan 2026
Read n integers and k. Output k elements with highest frequency. If tie, smaller number first. Output in order of frequency desc then number asc....