Skip to content

Instantly share code, notes, and snippets.

@JosephDunivan
Last active May 16, 2017 21:04
Show Gist options
  • Save JosephDunivan/f296fb5d9ffa0b63861de765ffca6825 to your computer and use it in GitHub Desktop.
Save JosephDunivan/f296fb5d9ffa0b63861de765ffca6825 to your computer and use it in GitHub Desktop.
Calculates the largest number possible given n digits.
def largestNumber(n)
new_array = Array.new(n, 9)
new_array.join.to_i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment