added solution in ruby