C# coding challenges

341 challenges you can solve in C#, from first loops to graphs, dynamic programming and machine learning. Write your code in the browser, run the tests instantly and get an AI review.

Easy · 193 Medium · 119 Hard · 29

Skills you'll practise: Nested loopsDigit extractionCountingLoopsString splittingConditionsSieve of Eratosthenes2D listsArithmeticBig number arithmeticCycle detectionDivisibility
  • 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
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
Easy

Text Message Abbreviations

Expand common texting abbreviations in a message into full words.

You'll learn String splittingLookup tables
BeginnerCS1HomeworkIntro programmingParsingStudent-beginner
No solutions yet
Medium

Longest Collatz Chain

Find the starting number up to a limit whose Collatz chain is longest.

You'll learn MemoizationSimulation
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Easy

Vowel Counter by Position

List the positions of every a, e, i, o and u in a piece of text.

You'll learn String indexingCase-insensitive comparison
BeginnerCS1HomeworkIntro programmingStudent-beginner
No solutions yet
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

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

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

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

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

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

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
Medium

Spell Checker

List the words in a text that are missing from a dictionary, ignoring case and punctuation.

You'll learn Hash setsTokenizing text
CS1CS50 styleDictionariesHash tablesHomeworkIntermediateIntro programmingStudent-beginner
No solutions yet
Medium

Circular Primes

Count the primes up to a limit whose every digit rotation is also prime.

You'll learn Primality testingDigit rotation
Competitive-programmingIntermediateNumber-theoryPrimesProject 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
Medium

Lexicographic Permutation

Find the k-th arrangement of some distinct characters in dictionary order.

You'll learn Factorial number systemCombinatorics
Competitive-programmingIntermediateNumber-theoryProject Euler styleRecursionmath
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