Basic Arithmetic Trio

Easy
5 views 25 Jan 2026
Given a and b, print a+b, a-b, and a*b on one line....

Even or Odd

Easy
4 views 25 Jan 2026
Check if n is even or odd....

Clamp a Number

Easy
6 views 25 Jan 2026
Input x lo hi. Print x clamped inside [lo,hi]....

Bitwise AND

Easy
8 views 25 Jan 2026
Given a and b, print a & b....

Max Using Ternary

Easy
6 views 25 Jan 2026
Print the bigger of two integers using a ternary expression....

Swap with XOR

Medium
7 views 25 Jan 2026
Swap two integers using XOR and print them....

Count Set Bits

Medium
7 views 25 Jan 2026
Print how many 1-bits are in n....

Check Nth Bit

Medium
6 views 25 Jan 2026
Input n and k (0-based). Print 1 if kth bit is set, else 0....

Toggle Nth Bit

Medium
7 views 25 Jan 2026
Input n and k (0-based). Flip kth bit and print new number....

XOR of Array

Medium
6 views 25 Jan 2026
Given n integers, print XOR of all values....

Fast Power Mod

Medium
6 views 25 Jan 2026
Input a b m. Print (a^b) mod m....

Bitwise OR Summary

Medium
7 views 25 Jan 2026
Given n numbers, print bitwise OR of them....

Add Without Plus

Hard
7 views 25 Jan 2026
Input a and b (non-negative). Add them using bit operations only....

Multiply Without Star

Hard
8 views 25 Jan 2026
Multiply a and b using only addition and bit shifts....

Divide Without Slash

Hard
5 views 25 Jan 2026
Input a b (a>=0, b>0). Print quotient and remainder without using / or %....

Evaluate Left-to-Right

Hard
5 views 25 Jan 2026
Expression tokens like: number op number op number. Evaluate strictly left-to-right (no precedence). Ops are + - *....

Bitmask Permissions

Hard
6 views 25 Jan 2026
Start with mask=0. Commands: GRANT k, REVOKE k, CHECK k. k is 0..30. CHECK prints 1/0....

XOR on Range

Hard
6 views 25 Jan 2026
Given L and R, print XOR of all integers in [L,R]....

Minimum Bit Flips

Hard
8 views 25 Jan 2026
Input a and b. Print how many bit flips to turn a into b....

Gray Code Value

Hard
6 views 25 Jan 2026
Input n. Print gray code g = n ^ (n>>1)....