Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def maxFraction(numerators, denominators)
- array_length = numerators.length
- x = 0
- largest = 0
- largest_value = 0.0
- while (x < array_length)
- if (numerators[x].to_f / denominators[x].to_f) > largest_value then
- largest = x
- largest_value = (numerators[x].to_f / denominators[x].to_f)
- end
- x = x + 1
- end
- return largest
- end
Advertisement
Add Comment
Please, Sign In to add comment