Created
July 8, 2014 10:29
-
-
Save eladmeidar/150fc22f9452e4c0b2ed to your computer and use it in GitHub Desktop.
ניקיטה הנסיך
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_trailing_zeros(array = []) | |
if array.size > 0 && array[-1].to_i == 0 | |
array.pop | |
remove_trailing_zeros(array) | |
else | |
array | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment