add problem 22 to ruby