Closed yvern closed 5 years ago
Hello! Thank you for your contribution to polyglot-euler.
polyglot-euler
parse does just that: reads the file, splits into names and sorts it
parse
score calculates the score of a single name, according to the rules
score
names "indexes" the iterator, by zipping it to a range, then multiplies the tuple (index, score), and sums the whole thing
names
range
using $ time coconut -n -r p022.coco
$ time coconut -n -r p022.coco
real 0m2.162s user 0m2.085s sys 0m0.071s
Hello! Thank you for your contribution to
polyglot-euler
.How the solution works
parse
does just that: reads the file, splits into names and sorts itscore
calculates the score of a single name, according to the rulesnames
"indexes" the iterator, by zipping it to arange
, then multiplies the tuple (index, score), and sums the whole thingPerformance
using
$ time coconut -n -r p022.coco