Created
June 18, 2019 18:42
-
-
Save maksar/8092d7cec581eec10720287c093f07e8 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 solution(input) | |
log_sum = input.map { |i| Math.log10(i) }.sum | |
input.map { |i| (10**(log_sum - Math.log10(i))).round } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment