Programming Challenges

Strengthen your problem-solving skills with language-neutral challenges you can solve in Python, C++, C#, Java, JavaScript, Go, Rust, Kotlin or Swift. Every submission is checked by automated tests and reviewed by AI.

  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
245
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

341 challenges
Hard

Longest Recurring Cycle

Find the d up to a limit whose fraction 1/d has the longest repeating decimal block.

You'll learn Long divisionCycle detection
AdvancedCompetitive-programmingDFSNumber-theoryProject Euler stylemath
No solutions yet
Medium

Longest Run of Rolls

Find where the longest run of equal consecutive dice rolls starts and how long it is.

You'll learn Array scanningTracking the best result
AP Computer ScienceCS1ClassesDiceHomeworkIntermediateIntro programmingOOPProbabilityStudent-beginner
No solutions yet
Easy

Factorial Digit Sum

Add up the decimal digits of n factorial.

You'll learn Big number arithmeticDigit manipulation
BeginnerBig integersCompetitive-programmingNumber-theoryProject Euler stylemath
No solutions yet
Medium

Amicable Pair

List every amicable pair whose two numbers are both at most a limit.

You'll learn Divisor-sum sievePair checks
CS1High schoolIntermediateLoopsNumber-theoryNumbersPrimesmath
No solutions yet
Medium

Modular Exponentiation

Compute base to the power exponent, modulo a number, with fast exponentiation.

You'll learn Exponentiation by squaringModular arithmetic
CS1High schoolIntermediateLoopsNumber-theoryNumbersPrimesmath
No solutions yet
Easy

Centered Star Pyramid

Print a centered pyramid of stars with an odd number of stars on each row.

You'll learn Nested loopsPadding
BeginnerCS1High schoolLoopsNested-loopsPatterns
No solutions yet
Easy

Word Scramble

Scramble words by swapping each vowel with the consonant right after it, scanning left to right.

You'll learn Character scanningSwapping
AP Computer ScienceBeginnerCS1ClassesGamesHomeworkIntro programmingOOPStudent-beginner
No solutions yet
Easy

Self Powers Tail

Find the last k digits of 1^1 + 2^2 + ... + n^n.

You'll learn Modular arithmeticFast exponentiation
BeginnerBig integersCompetitive-programmingNumber-theoryProject Euler stylemath
No solutions yet
Easy

Digit Sum of a Power of Two

Add up the decimal digits of 2 raised to the power n.

You'll learn Big number arithmeticDigit manipulation
BeginnerBig integersCompetitive-programmingNumber-theoryProject Euler stylemath
No solutions yet
Hard

Digit Factorial Chains

Count starting numbers whose digit factorial chain has exactly a given number of distinct terms.

You'll learn Cycle detectionMemoization
AdvancedCompetitive-programmingNumber-theoryProject Euler stylemath
No solutions yet
Easy

Distinct Powers

Count the different values of a to the power b for a and b in a range.

You'll learn Perfect powersSets
BeginnerCompetitive-programmingNumber-theoryProject Euler stylemath
No solutions yet
Medium

Name Scores

Sort a list of names and add up each name's letter value times its position.

You'll learn Sorting stringsCharacter codes
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Easy

Grocery List Totals

Add up a grocery receipt in cents, charging sales tax only on taxable items.

You'll learn Parsing recordsInteger money math
BeginnerCS1FinanceHomeworkIntro programmingStudent-beginner
No solutions yet
Medium

Derangements

Count the arrangements of n items where nothing stays in its original place.

You'll learn RecurrencesCombinatorics
CS1Dynamic-programmingHigh schoolIntermediateLoopsNumbersmath
No solutions yet
Medium

Butterfly Pattern

Print a butterfly: two star triangles facing each other that grow until they touch, then shrink again.

You'll learn Nested loopsSymmetry
CS1High schoolIntermediateLoopsNested-loopsPatterns
No solutions yet
Easy

Twin Primes

List all twin prime pairs (p, p + 2) up to a limit.

You'll learn Sieve of EratosthenesPairing neighbours
BeginnerCS1High schoolLoopsNumber-theoryNumbersPrimesmath
No solutions yet
Medium

Grayscale Filter

Turn a grid of packed RGB pixels into grayscale using weighted channel brightness.

You'll learn Bit shiftingInteger rounding
Bit manipulationCS1CS50 styleGridsHomeworkImage processingIntermediateIntro programmingMatricesStudent-beginner
No solutions yet
Medium

Nth Prime

Return the nth prime number, counting 2 as the first.

You'll learn Prime testingSieve of Eratosthenes
CS1High schoolIntermediateLoopsNumber-theoryNumbersPrimesmath
No solutions yet