Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joshwcomeau/katas

A bunch of CodeWars challenge solutions. Part of an ongoing blogging effort at https://medium.com/@joshuawcomeau
https://github.com/joshwcomeau/katas

Last synced: 17 days ago
JSON representation

A bunch of CodeWars challenge solutions. Part of an ongoing blogging effort at https://medium.com/@joshuawcomeau

Awesome Lists containing this project

README

        

#Coding Challenges

One of my favorite pastimes is solving short, concise programming problems. This repo is a collection of such problems, sourced from sites like [Code Wars](http://www.codewars.com) and [Project Euler](https://projecteuler.net). The solutions are documented in detail on [my Medium blog](https://medium.com/@joshuawcomeau).

--------

###Problem 1: Moving Window
This straight-forward math/programming challenge from CodeWars asks you to find the largest 5-digit number in a series. For example, the largest 2-digit number in `19285` is 92.
[Problem](http://www.codewars.com/kata/51675d17e0c1bed195000001) | [My Solution](https://github.com/joshwcomeau/katas/tree/master/1_moving_window) | [Blog Post](https://medium.com/@joshuawcomeau/weekly-challenge-01-93d562c06d6d)

--------

###Problem 2: LRU Cache
Also from CodeWars, this problem asks you to create a Least-Recently-Used cache. It's an incredibly enlightening exercise; `Object.defineProperty` is amazing.
[Problem](http://www.codewars.com/kata/53b406e67040e51e17000c0a/train/javascript) | [My Solution](https://github.com/joshwcomeau/katas/tree/master/2_lru_cache) | [Blog Post](https://medium.com/@joshuawcomeau/weekly-challenge-02-771053cfd380)

--------

###Problem 3: Happy Numbers
From Project Euler, this problem is much more math-focused, and asks you to calculate how many 'unhappy' numbers there are below 10 million.
[Problem](https://projecteuler.net/problem=92) | [My Solution](https://github.com/joshwcomeau/katas/tree/master/3_happy_numbers) | [Blog Post](https://medium.com/@joshuawcomeau/weekly-challenge-iii-d54223ec9667)

--------

###Problem 4: Sudoku Validation
From CodeWars, this is a simple problem: Write a script that will validate a Sudoku, passed in as a 2D array of numbers. It takes some inspiration from functional programming, in the form of avoiding side effects, not mutating data, and using short, single-purpose functions.
[Problem](http://www.codewars.com/kata/did-i-finish-my-sudoku/) | [My Solution](https://github.com/joshwcomeau/katas/tree/master/4_sudoku_validator) | [Blog Post](https://medium.com/@joshuawcomeau/sudoku-validation-2eb4e7d2a6ca)

--------

###Problem 5: Dependency Injection
A homegrown mini framework for handling dependencies with dependency injection. Turns out it's pretty straightforward!
[Problem](http://www.codewars.com/kata/did-i-finish-my-sudoku/) | [My Solution](https://github.com/joshwcomeau/katas/tree/master/4_sudoku_validator) | [Blog Post](https://medium.com/@joshuawcomeau/sudoku-validation-2eb4e7d2a6ca)