CodinGame puzzle solutions, explained step by step
Free, explained solutions to 39 CodinGame solo puzzles. Each page restates the problem, walks through the approach step by step, gives the complexity, the commented code (C, Java or Python) and the mistakes that make test cases fail.
Add to Chrome★ 5.0 · 16 reviews · 928 usersSolutions en françaisPreparation guides by platformLanguage MCQs with answers
Easy puzzles
11Perfect if you are new to programming or learning a new language: input/output, conditions, loops, strings and simple searches.
ASCII Artstring slicing, character codes, index arithmeticCChuck Norrisbinary encoding, run-length encoding, string buildingCDefibrillatorsstring parsing, distance formula, linear searchCHorse-racing Dualssorting, adjacent differences, greedyCMars Lander - Episode 1simulation, physics, control loopCMIME Typehash map, string parsing, case-insensitive lookupCOnboardinggame loop, input parsing, conditionalsCPower of Thor - Episode 1game loop, coordinates, greedyCSkynet: The Chasmsimulation, game loop, conditionsCTemperatureslinear search, absolute value, tie-breakingCThe Descentgame loop, linear search, argmaxC
Medium puzzles
17Classic algorithms start here: binary search, BFS on graphs, sorting, dictionaries and careful simulation.
Bender - Episode 1simulation, state machine, loop detectionCConway Sequencelook-and-say, run-length encoding, listsCDeath First Search - Episode 1BFS, graphs, shortest pathJavaDwarfs standing on the shoulders of giantsdirected acyclic graph, longest path, DFS with memoizationPythonIndiana - Episode 1simulation, lookup table, 2D gridPythonMars Lander - Episode 2physics simulation, control logic, trigonometryJavaMayan Calculationbase conversion, string parsing, 2D character gridsCNetwork Cablingmedian, sorting, greedyCScrabbleletter counting, string processing, linear searchCShadows of the Knight - Episode 1binary search, 2D search, interactive puzzleCStock Exchange Lossesrunning maximum, single pass, arraysCTeads Sponsored Contesttrees, BFS, graph diameterJavaTelephone Numberstrie, prefix tree, stringsCThe Giftgreedy, sorting, integer divisionCThe Paranoid Androidsimulation, greedy, game loopCThere is no Spoon - Episode 12D grid, nearest neighbour scan, string parsingCWinamax Battlesimulation, queues, card gamePython3
Hard puzzles
10Shortest paths (Dijkstra), backtracking, flood fill, scheduling and dynamic programming on larger inputs.
Bender - Episode 2dynamic programming, DAG, longest pathJavaBender - Episode 3complexity analysis, curve fitting, statisticsPythonCGX Formatterparsing, recursive descent, string manipulationJavaGenome Sequencingshortest common superstring, permutations, string overlapPythonShadows of the Knight - Episode 2binary search, geometry, interactivePythonSuper Computergreedy, interval scheduling, sortingPythonSurfaceflood fill, BFS, connected componentsJavaTAN NetworkDijkstra, shortest path, graphsJavaThe Bridge - Episode 2DFS, backtracking, simulationJavaThe LabyrinthBFS, exploration, pathfindingJava
Very hard puzzles
1Optimisation and advanced data structures where a naive approach times out.