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