Ruby solutions for hackerrank warmup problems