Practice problems
Write a solution, press Judge β the browser runs it against hidden tests right on your device. No account, no server, drafts saved locally. Ctrl+Enter judges.
Beginner
-
1. Sum of Two Numbers I/O + parse
ReadLine, Split, int.Parse β the read β compute β print cycle every program is built on.
-
2. Sum from 1 to N loops + accumulator
The accumulator pattern, plus Gauss's O(1) shortcut β two valid solutions, same tests.
-
3. Maximum of Three if/else + edge cases
Running maximum with negatives and ties in the hidden tests β initializing max = 0 will bite you.
-
4. Count the Digits while + division
The % 10 / 10 digit-peeling loop, with n = 0 and negative input as the traps.
-
5. Digit Sum digit peeling
Same peel loop as Count the Digits, but summing instead of counting β 1234 β 10.
-
6. Leap Year boolean logic
Divisible by 4, except centuries, unless by 400 β 1900 and 2000 are the hidden traps.
Easy+
-
7. Reverse a Number digit building
12345 β 54321 with
rev = rev * 10 + n % 10β and why 1000 correctly becomes 1. -
8. Palindrome Number pattern reuse
A palindrome equals its own reversal β reuse problem 7's pattern and compare.
-
9. Factorial accumulator + overflow
n up to 12 only β 13! overflows int. The constraint IS the lesson.
Medium
-
10. Star Pyramid nested loops + exact output
Leading spaces are part of the answer β the judge compares them, whitespace and all.
-
11. GCD Euclid's algorithm
gcd(a, b) = gcd(b, a mod b) β the oldest algorithm still in daily use, three lines long.
-
12. Prime Check trial division + βn
Test divisors only up to βn, break on the first hit β 1, 25 and a six-digit prime in the tests.
-
13. Fibonacci Number sliding pair
The sliding pair makes 45 passes where naive recursion makes two billion β same math.
-
14. Decimal to Binary base conversion
The classic % 2 / 2 loop β 0 is the trap.
-
15. Count the Primes nested loops
Prime Check inside a loop; break decides pass or timeout.
-
16. Armstrong Number digit logic
153 = 1Β³+5Β³+3Β³ β peel, cube, accumulate.
-
17. Matrix Diagonal Sum multi-line input
First multi-line read β no need to store the grid.
-
18. Word Count strings
Repeated spaces make empty pieces; count only non-empty.
How judging works
Your code runs in the same in-browser engine as the playground, once per hidden test. Output is compared line by line, ignoring trailing whitespace. Failed tests show the input, expected output and your output side by side, so the diff is the lesson.