Ruby solutions to the Codility exercises at https://codility.com/programmers/lessons/
All solutions are optimized for speed. Unfortunately, that kinda kills being idiomatic sometimes.
These solutions were curated with lots of help from jsuchal.
Run all the tests: $ rspec
A Rubyist's Guide to Big-O Notation
Rules of thumb:
- Finding a specific item in a Hash is faster than in an Array
- Avoid nested loops