solution to 1.1 in rb
solution to 1.1 in c