6 views
23 Jan 2026
Task: return sum of numbers from 1..n that are divisible by 3. Use loop and if condition....
4 views
23 Jan 2026
Task: return how many digits are in an integer. Handle 0 properly....
4 views
23 Jan 2026
Task: reverse digits of a number and return result (ignore overflow for now)....
5 views
23 Jan 2026
Task: return true if year is leap year using correct rules (divisible by 400, or divisible by 4 but not 100)....
6 views
23 Jan 2026
Task: return total stars printed in a triangle of height n (1+2+...+n)....
5 views
23 Jan 2026
Task: count how many numbers in 1..n would print FizzBuzz (div by 3 and 5)....
4 views
23 Jan 2026
Task: return nth Fibonacci number (0-indexed) using iterative loop....
5 views
23 Jan 2026
Task: return gcd(a,b) using while loop (Euclid algorithm)....
3 views
23 Jan 2026
Task: return the first prime number that is >= n....
5 views
23 Jan 2026
Task: given balance and withdrawals array, process in order. If withdrawal > balance skip it. Return final balance....
4 views
23 Jan 2026
Task: you can add 1 or 2 each move. Return minimum moves to reach exactly n....
5 views
23 Jan 2026
Task: grid has 0 (free) and 1 (blocked). Return number of paths from (0,0) to (m-1,n-1) moving right/down....
5 views
23 Jan 2026
Task: given a char array containing '(', ')', return true if it is balanced....
4 views
23 Jan 2026
Task: return the first index where a[i] >= target in a sorted array, else return n....
4 views
23 Jan 2026
Task: return maximum subarray sum (at least one element)....