Reverse is not needed

This commit is contained in:
David Doblas Jiménez 2021-08-25 19:03:54 +02:00
parent 6297a364af
commit 32a5e5c01e

View File

@ -11,7 +11,8 @@ https://projecteuler.net/problem=30
using BenchmarkTools using BenchmarkTools
function power_digit_sum(pow, n) function power_digit_sum(pow, n)
return sum(c^pow for c in reverse(digits(n))) # return sum(c^pow for c in reverse(digits(n)))
return sum(c->c^pow, digits(n))
end end
function Problem30() function Problem30()