shorter and IMHO better Python solution
better but longer JavaScript solution
Merge pull request #24 from panzi/master

shorter and IMHO better Python solution