Skip to content

Instantly share code, notes, and snippets.

@eladmeidar
Created July 8, 2014 10:29
Show Gist options
  • Save eladmeidar/150fc22f9452e4c0b2ed to your computer and use it in GitHub Desktop.
Save eladmeidar/150fc22f9452e4c0b2ed to your computer and use it in GitHub Desktop.
ניקיטה הנסיך
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