-
-
Save hsinewu/78d7426cb640f1b56a305026da57144e to your computer and use it in GitHub Desktop.
csv product in FP
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
1 2 3 4 5 |
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
fmap (product.map read.words) getLine |
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
from functools import reduce # reduce is moved to functools in python3 :( | |
reduce(lambda x,y: x*y, map(int, input().split())) |
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
gets.split.map(&:to_i).inject(&:*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment