My quick-n-dirty Hackerrank code.