18 Dec · Robert Eisele
Programming Puzzle Solutions
Competitive programming is a focused way to sharpen algorithmic thinking. These are worked solutions — not shortcuts, but walkthroughs of the ideas, trade-offs, and optimizations that lead to efficient answers.
Project Euler
- Project Euler Solution #1: Multiples of 3 and 5
- Project Euler Solution #2: Even Fibonacci numbers
- Project Euler Solution #3: Largest prime factor
- Project Euler Solution #4: Largest palindrome product
- Project Euler Solution #5: Smallest multiple
- Project Euler Solution #6: Sum square difference
- Project Euler Solution #7: 10001st prime
- Project Euler Solution #8: Largest product in a series
- Project Euler Solution #9: Special Pythagorean triplet
- Project Euler Solution #10: Summation of primes
- Project Euler Solution #11: Largest product in a grid
- Project Euler Solution #12: Highly divisible triangular number
- Project Euler Solution #13: Large sum
- Project Euler Solution #14: Longest Collatz sequence
- Project Euler Solution #15: Lattice paths
- Project Euler Solution #16: Power digit sum
- Project Euler Solution #17: Number letter counts
- Project Euler Solution #18: Maximum path sum I
- Project Euler Solution #19: Counting Sundays
- Project Euler Solution #20: Factorial digit sum
- Project Euler Solution #21: Amicable numbers
- Project Euler Solution #22: Names scores
- Project Euler Solution #23: Non-abundant sums
- Project Euler Solution #24: Lexicographic permutations
- Project Euler Solution #25: 1000-digit Fibonacci number
- Project Euler Solution #26: Reciprocal cycles
- Project Euler Solution #27: Quadratic primes
- Project Euler Solution #28: Number spiral diagonals
- Project Euler Solution #29: Distinct powers
- Project Euler Solution #30: Digit fifth powers
- Project Euler Solution #31: Coin sums
- Project Euler Solution #32: Pandigital products
- Project Euler Solution #33: Digit cancelling fractions
- Project Euler Solution #34: Digit factorials
- Project Euler Solution #35: Circular primes
- Project Euler Solution #36: Double-base palindromes
- Project Euler Solution #37: Truncatable primes
- Project Euler Solution #38: Pandigital multiples
- Project Euler Solution #39: Integer right triangles
- Project Euler Solution #40: Champernowne's constant
- Project Euler Solution #41: Pandigital prime
- Project Euler Solution #42: Coded triangle numbers
- Project Euler Solution #43: Sub-string divisibility
- Project Euler Solution #44: Pentagon numbers
- Project Euler Solution #45: Triangular, pentagonal, and hexagonal
- Project Euler Solution #46: Goldbach's other conjecture
- Project Euler Solution #47: Distinct primes factors
- Project Euler Solution #48: Self powers
- Project Euler Solution #49: Prime permutations
- Project Euler Solution #50: Consecutive prime sum
- Project Euler Solution #52: Permuted multiples
- Project Euler Solution #55: Lychrel numbers
- Project Euler Solution #56: Powerful digit sum
- Project Euler Solution #57: Square root convergents
- Project Euler Solution #58: Spiral primes
- Project Euler Solution #59: XOR decryption
- Project Euler Solution #62: Cubic permutations
- Project Euler Solution #63: Powerful digit counts
- Project Euler Solution #64: Odd period square roots
- Project Euler Solution #67: Maximum path sum II
- Project Euler Solution #69: Totient maximum
- Project Euler Solution #71: Ordered fractions
- Project Euler Solution #72: Counting fractions
- Project Euler Solution #81: Path sum: two ways
- Project Euler Solution #92: Square digit chains
- Project Euler Solution #107: Minimal network
CodinGame
- 1D Bush Fire
- ANEO Sponsored Puzzle
- Apple tree
- ASCII Art
- Bag of Balls
- Balanced ternary computer: encode
- Bank Robbers
- Bender - Episode 1
- Bender - Episode 3
- Benford's law
- Binary Permutations
- Block Number Sequence
- Blowing Fuse
- Caesar Box
- CGFunge interpreter
- CGX Formatter
- Chuck Norris
- Conway Sequence
- Create the longest sequence of 1s
- Darts
- Dead men's shot
- Defibrillators
- Digit sum successor
- Disks intersection
- Divide the factorial
- Divisibility windows
- Don't Panic - Episode 1
- Dwarfs standing on the shoulders of giants
- Egyptian multiplication
- Execution Circle
- Expand the polynomial
- Factorial vs Exponential
- Fill the Square!
- Genome Sequencing
- Goro Want Chocolate
- Highest truncated pyramid
- Horse-racing Duals
- Horse-racing Hyperduals
- ISBN Check digit
- Lumen
- Magic count of numbers
- Mars Lander - Episode 1
- Mayan Calculation
- Merlin's Magic Square
- MIME Type
- Minimal Ball Cost
- Minimal number of swaps
- Mystery sums
- Network Cabling
- Next car license plate
- Number of letters in a number - Binary
- Number of Network Hosts
- Number staircase
- Numeral system
- Offset Arrays
- Onboarding
- Pirate's treasure
- Power of Thor - Episode 1
- Pyramid height
- Recurring Decimals
- Roller Coaster
- Rubik
- Scrabble
- Shadows of the Knight - Episode 1
- Simple fraction to mixed number
- Simultaneous Ages
- Skynet Revolution - Episode 1
- Stock Exchange Losses
- Sum of divisors
- Super Computer
- Surface
- TAN Network
- Teads Sponsored Contest
- Telephone Numbers
- Temperatures
- The Descent
- The Fastest
- The Gift
- The greatest element
- The greatest number
- The Holy Grail
- The Last Crusade - Episode 1
- The Resistance
- The River I.
- The River II.
- The Travelling Salesman Problem
- Vortex
- War
- Magic stones
HackerRank
- Hackerrank Solution: Anti-Palindromic Strings
- Hackerrank Solution: Best Divisor
- Hackerrank Solution: Circle City
- Hackerrank Solution: Closest Number
- Hackerrank Solution: Connecting Towns
- Hackerrank Solution: Counting Valleys
- Hackerrank Solution: Easy GCD
- Hackerrank Solution: Easy sum
- Hackerrank Solution: Equations
- Hackerrank Solution: Even Odd Query
- Hackerrank Solution: Find the Point
- Hackerrank Solution: Jumping on the Clouds
- Hackerrank Solution: Leonardo's Prime Factors
- Hackerrank Solution: Little Gaurav and Sequence
- Hackerrank Solution: Little Panda Power
- Hackerrank Solution: Manasa and Factorials
- Hackerrank Solution: Maximizing XOR
- Hackerrank Solution: Minimum Height Triangle
- Hackerrank Solution: Recursive Digit Sum
- Hackerrank Solution: Repeated String
- Hackerrank Solution: Restaurant
- Hackerrank Solution: Sherlock and Array
- Hackerrank Solution: Sherlock and Divisors
- Hackerrank Solution: Sherlock and GCD
- Hackerrank Solution: Sherlock and Pairs
- Hackerrank Solution: Sherlock and Permutations
- Hackerrank Solution: Sherlock and Squares
- Hackerrank Solution: Special Multiple
- Hackerrank Solution: Summing the N series
- Hackerrank Solution: Sum vs XOR
- Hackerrank Solution: The Great XOR
CodeSignal
- Codesignal Solution: alienShip
- Codesignal Solution: Bottles_1
- Codesignal Solution: Bottles_2
- Codesignal Solution: caesarian
- Codesignal Solution: circumcircle
- Codesignal Solution: Complete the Sequence
- Codesignal Solution: Computer Units to Byte
- Codesignal Solution: extendedFibonacci
- Codesignal Solution: Factorial
- Codesignal Solution: FaroShuffles
- Codesignal Solution: fibonacciWord
- Codesignal Solution: Grouped Bits
- Codesignal Solution: Is Permutation Of
- Codesignal Solution: isTournament
- Codesignal Solution: Matrix Perimeter
- Codesignal Solution: maxBits
- Codesignal Solution: Minimum Jump To Reach End
- Codesignal Solution: monkeyBars
- Codesignal Solution: Near Square
- Codesignal Solution: nextSquare
- Codesignal Solution: No odd Digits
- Codesignal Solution: nthPlace
- Codesignal Solution: offsets
- Codesignal Solution: onesPosition
- Codesignal Solution: Only Survivor
- Codesignal Solution: Poker Chips
- Codesignal Solution: primeClimb
- Codesignal Solution: reciprocal
- Codesignal Solution: sumOdious
- Codesignal Solution: surviveIt
- Codesignal Solution: totalBinSum
- Codesignal Solution: TwoFive
Misc Puzzles
- Advent calendar motifs
- An interesting Limit
- Cracking Apple Interview Question
- Division with remainder
- Find the Parity of the Sum of floor(n/k) from k=1 to n
- Inscribed Squares
- Number Guessing
- Pre-School Math Problem
- Probability to win in a Tombola
- Solution to the Water Jug Problem
- Solve exponential equation \(6^x + 4^x = 9^x\)
- Solve exponential equation \(x^y = y^x\)
- Sum of Digit-Sums between one and a million
- The rope around the equator
- Three Digits Number
- Tipping Point Problem