Last active
May 16, 2017 21:04
-
-
Save JosephDunivan/f296fb5d9ffa0b63861de765ffca6825 to your computer and use it in GitHub Desktop.
Calculates the largest number possible given n digits.
This file contains hidden or 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 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