Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rightmostRoundNumber(inputArray)
- x = 0
- array_length = inputArray.length
- number = 0
- found = false
- while (x < array_length)
- if inputArray[x] % 10 == 0 then
- number = x
- found = true
- end
- x = x + 1
- end
- if found == true then
- return number
- else
- return -1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment