Tenth exercise of ruby