4 views
25 Jan 2026
Given a sorted array and X, count pairs (i...
6 views
25 Jan 2026
Commands: PUSH x, POP, ROTATE k (move first to end k times). Print final queue (space-separated)....
8 views
25 Jan 2026
Given n intervals [l,r], find the maximum number of overlaps at any point....
6 views
25 Jan 2026
Given marks (0..100), print grade: A(90+), B(80-89), C(70-79), D(60-69), else F....
5 views
25 Jan 2026
Print YES if the year is a leap year, otherwise NO....
7 views
25 Jan 2026
Given a and b, print |a-b|....
5 views
25 Jan 2026
Given n, print n! using a loop....
4 views
25 Jan 2026
You get n and then n integers. Count how many are > 0....
6 views
25 Jan 2026
Print numbers 1..n, but print Fizz for multiples of 3, Buzz for multiples of 5, and FizzBuzz for both....
5 views
25 Jan 2026
Read integers until you see 0. Print the sum of numbers before 0....
5 views
25 Jan 2026
Given n, print PRIME if n is prime else NOT_PRIME....
5 views
25 Jan 2026
Print how many digits are in n (for n=0, answer is 1)....
6 views
25 Jan 2026
Starting from n, apply: if even n=n/2 else n=3n+1. Count steps to reach 1....
5 views
25 Jan 2026
Given n numbers and x, print the first number that is > x. If none, print -1....
7 views
25 Jan 2026
Given r and c and the matrix values, print the minimum value....
5 views
25 Jan 2026
Input is a string with (), [], {}. Print YES if it is balanced, else NO....
6 views
25 Jan 2026
Colors cycle: Red -> Green -> Yellow -> Red. Given start color and t steps, print final color....
5 views
25 Jan 2026
Start value=0. Commands: ADD x, SUB x, MUL x, DIV x (integer, ignore if x=0). Print final value....
8 views
25 Jan 2026
Given n integers, find the length of the longest strictly increasing contiguous run....
4 views
25 Jan 2026
Given r c and a grid of 0/1, apply one step of Conway's Game of Life and print new grid....