ruby gigasecond solution