5 views
24 Jan 2026
Read n and a text line a, output the same line a exactly n times (each on new line)....
3 views
24 Jan 2026
Read n, output square of every number from 1 to n, one per line....
3 views
24 Jan 2026
First number t is provided. For each testcase, two integers a and b are provided. Output a+b for each testcase....
3 views
24 Jan 2026
Read t lines. For each line, count how many characters are digits (0-9) and output the count....
4 views
24 Jan 2026
Read t integers. For each number, reverse its digits and keep the sign. Example -120 becomes -21....
4 views
24 Jan 2026
Read t integers. Output EVEN if number is even else ODD for each testcase....
4 views
24 Jan 2026
Read t lines. For each line, remove leading and trailing spaces and output the length of the remaining text....
4 views
24 Jan 2026
For each testcase you get three integers. Output the minimum among them....
5 views
24 Jan 2026
Read n, output a right triangle of stars. Line i has i stars (1 to n)....
3 views
24 Jan 2026
Read n numbers. Output prefix sum after each element (same order)....
5 views
24 Jan 2026
Read t pairs a b. For each pair output gcd(a,b)....
4 views
24 Jan 2026
Read t testcases. Each testcase has n and array. Output YES if array is non-decreasing else NO....
4 views
24 Jan 2026
For each testcase you get string s and integer k. Rotate string to the right by k and output the new string....
5 views
24 Jan 2026
For each testcase you get a full line sentence. Count unique words ignoring case and output the count....
4 views
24 Jan 2026
For each testcase you get string s. Output index (0-based) of first character that appears exactly once. If none, output -1....
4 views
24 Jan 2026
For each testcase you get n, k and n numbers. Output max of each window of size k (space-separated)....
4 views
24 Jan 2026
For each testcase you get n numbers. Compute length of the longest prefix that is strictly increasing....
4 views
24 Jan 2026
Each testcase has n numbers and q queries (l r, 1-based). Output sum for each query....
3 views
24 Jan 2026
For each testcase you get n integers. Sort them by frequency descending. If frequency same, smaller number first. Output sorted list....
6 views
24 Jan 2026
For each testcase you get n and array of size n with numbers 1..n, but one number is missing and one is repeated. Output missing and duplicate....
4 views
24 Jan 2026
For each testcase you get string s. Repeatedly remove adjacent equal characters using a stack idea. Output final string (or EMPTY)....
4 views
24 Jan 2026
For each testcase you get n, target and n integers. Output first pair indices i j (0-based) such that a[i]+a[j]=target. If not found output -1 -1....
3 views
24 Jan 2026
For each testcase you get n, m and n integers. Count how many numbers give remainder 0..m-1 when divided by m. Output counts in one line....
5 views
24 Jan 2026
For each testcase you get two sorted arrays. Output unique common elements in increasing order (space-separated) or EMPTY....
3 views
24 Jan 2026
For each testcase you get n, k and n integers. Output the k-th largest element....
4 views
24 Jan 2026
For each testcase you get n and q updates. Each update adds val to all positions l..r (1-based). After all updates output final array....
4 views
24 Jan 2026
For each testcase you get n, k and n integers. Count number of subarrays whose XOR is exactly k....
5 views
24 Jan 2026
For each testcase you get array where a[i] is max jump length from i. Compute minimum jumps to reach last index, else -1....
4 views
24 Jan 2026
For each testcase you get weighted undirected graph. Output shortest distance from 1 to n. If unreachable output -1....
4 views
24 Jan 2026
For each testcase you get n. Output Fibonacci(n) modulo 1000000007. Use fast doubling so big n is also ok....
3 views
24 Jan 2026
For each testcase you get n, k and n integers. For each window of size k output how many distinct numbers are inside....
4 views
24 Jan 2026
For each testcase you get string s. Output length of longest palindromic subsequence....
4 views
24 Jan 2026
For each testcase you get n bar heights. Compute largest rectangle area in histogram....
3 views
24 Jan 2026
For each testcase you get a tree with n nodes. Output the diameter length (number of edges on longest path)....
5 views
24 Jan 2026
For each testcase you get a directed graph. If topological order exists, output one order. If cycle exists, output CYCLE....