Some code samples from hackerrank.com/y_hax