Created
August 1, 2020 20:22
-
-
Save lbvf50mobile/a45b8198e1c8a121d792e9c4ee82f340 to your computer and use it in GitHub Desktop.
Codewars.com: Nth power rules them all!
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
# https://www.codewars.com/kata/58aed2cafab8faca1d000e20 Nth power rules them all! | |
def modified_sum(a, n): | |
return sum(x**n for x in a) - sum(a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment