Update euler10.rb

Refactor