help solve a coding challenge. challenge already solved in pyhton but need to convert to Ruby code

Job ID: 30916689

Budget: €30 – €250 EUR

need some help converting the solution of a coding challenge from python code to ruby
Related categories: Python Ruby