Basic Calculator

Easy
3 views 24 Jan 2026
Input has two integers a and b and an operator op are provided (+, -, *, /, %). For / do integer floor division like Python //. Output the result....

Quotient and Remainder

Easy
2 views 24 Jan 2026
Input has two integers a and b are provided (b != 0). Output quotient (a//b) and remainder (a%b) in one line....

Even Odd Using Mod

Easy
3 views 24 Jan 2026
Read one integer n. Output EVEN if n is even else ODD....

Compare Two Numbers

Easy
3 views 24 Jan 2026
Read two integers a and b. Output < if a if a>b else =....

In Range Check

Easy
2 views 24 Jan 2026
Read three integers x L R. Output YES if L...

Minimum of Three

Easy
4 views 24 Jan 2026
Read three integers a b c. Output the minimum using operators and comparisons....

Bitwise AND

Easy
2 views 24 Jan 2026
Read two non-negative integers a and b. Output a & b....

Bitwise OR

Easy
2 views 24 Jan 2026
Read two non-negative integers a and b. Output a | b....

Bitwise XOR

Easy
2 views 24 Jan 2026
Read two non-negative integers a and b. Output a ^ b....

Toggle Kth Bit

Easy
3 views 24 Jan 2026
Read two integers n and k. Toggle (flip) the k-th bit (0-based) of n and output the new number....

Expression Value A

Medium
3 views 24 Jan 2026
Four integers a b c d are provided. Compute (a+b)*c - d and output it....

Expression Value B

Medium
2 views 24 Jan 2026
Read three integers a b c. Compute a + b*c and a*b + c. Output both in one line....

Power Mod

Medium
2 views 24 Jan 2026
Integers a b m are provided. Output (a^b) % m. Use fast power (pow with mod)....

Kth Bit Check

Medium
3 views 24 Jan 2026
Read two non-negative integers n and k. Output 1 if k-th bit (0-based) of n is set, else 0....

Count Set Bits

Medium
3 views 24 Jan 2026
One non-negative integer n is provided. Count how many 1 bits are in binary representation and output it....

Remove Rightmost Set Bit

Medium
7 views 24 Jan 2026
One non-negative integer n is provided (n>0). Remove the rightmost set bit once and output the new number....

Opposite Signs

Medium
4 views 24 Jan 2026
Read two integers a and b. Output YES if they have opposite signs (one negative, one positive). If any is zero, output NO....

Missing Number XOR

Medium
3 views 24 Jan 2026
Read n-1 numbers from 1..n (one is missing). Compute the missing number using XOR....

Hamming Distance

Medium
2 views 24 Jan 2026
Read two non-negative integers a and b. Hamming distance is number of different bits. Output it....

Multiply By Power of Two

Medium
3 views 24 Jan 2026
Read two integers x and k. Output x * (2^k) using shift operator....

Divide By Power of Two

Medium
3 views 24 Jan 2026
Input has two integers x and k are provided (k>=0). Output floor(x / (2^k)) using right shift (for non-negative x)....

32-bit Left Rotate

Medium
3 views 24 Jan 2026
Read two integers x and r. Treat x as unsigned 32-bit. Rotate left by r and output the unsigned result....

Add Without Plus

Hard
3 views 24 Jan 2026
Read two integers a and b. Add them without using + or -. Use bit operations and output sum....

Make Number Even

Medium
2 views 24 Jan 2026
Read one integer n. In one move you can add 1 or subtract 1. Output minimum moves needed to make n even....

Reduce Fraction

Medium
2 views 24 Jan 2026
Input has two integers p and q are provided (q != 0). Reduce the fraction p/q and output as p q (reduced). Keep denominator positive....

Bitmask From Indices

Medium
4 views 24 Jan 2026
Read n and then k indices (0-based). Build a bitmask with those bits set and output it as integer....

Next Number Same Bitcount

Hard
3 views 24 Jan 2026
One non-negative integer n is provided (n>0). Compute the smallest integer > n that has the same number of set bits. Output it....

Min Flips To Match OR

Hard
3 views 24 Jan 2026
Read three non-negative integers a b c. In one flip you can change one bit of a or b. Compute minimum flips needed so that (a | b) == c....

Total Hamming Distance

Hard
2 views 24 Jan 2026
Read n integers, total Hamming distance is sum of distances over all pairs (i...

Maximum XOR Pair

Hard
5 views 24 Jan 2026
Read n integers, find maximum value of ai ^ aj over all pairs. Output the maximum XOR....

Huge Power Mod (Exponent as String)

Hard
3 views 24 Jan 2026
Integers a and m are provided, and exponent b is provided as a very large decimal string. Output (a^b) % m....

Bitwise Subset XOR Sum

Hard
3 views 24 Jan 2026
Read n numbers, consider all subsets. For each subset take XOR of its elements. Output the sum of XOR over all subsets....

Range XOR Queries

Hard
3 views 24 Jan 2026
Read array of n integers and q queries (l r). For each query output XOR of a[l..r] (1-based)....

Bitwise AND Over Range

Hard
3 views 24 Jan 2026
Read n integers and q queries (l r). For each query output bitwise AND of a[l..r] (1-based)....

Boolean XOR Expression

Hard
3 views 24 Jan 2026
A boolean string s of 0/1 and a boolean string t of 0/1 are provided, same length. Treat them as bits and compute (s XOR t) as a new string. Output it....