Merge pull request #2 from dudarev/master

Python version
Solution on ruby.
Merge pull request #3 from dmitriy-kiriyenko/dak-rb

Solution on ruby.
Add scala solution.
Merge pull request #4 from dmitriy-kiriyenko/dak-scala

Add scala solution.
Merge branch 'master', remote-tracking branch 'upstream/master'
new version of python script, version with memoizations is added