Adding my homework written on Ruby