mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Set the Python file maximum line length to 88 characters (#2122)
* flake8 --max-line-length=88 * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
""" Problem Statement (Digit Fifth Power ): https://projecteuler.net/problem=30
|
||||
|
||||
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
|
||||
Surprisingly there are only three numbers that can be written as the sum of fourth
|
||||
powers of their digits:
|
||||
|
||||
1634 = 1^4 + 6^4 + 3^4 + 4^4
|
||||
8208 = 8^4 + 2^4 + 0^4 + 8^4
|
||||
@ -9,7 +10,8 @@ As 1 = 1^4 is not a sum it is not included.
|
||||
|
||||
The sum of these numbers is 1634 + 8208 + 9474 = 19316.
|
||||
|
||||
Find the sum of all the numbers that can be written as the sum of fifth powers of their digits.
|
||||
Find the sum of all the numbers that can be written as the sum of fifth powers of their
|
||||
digits.
|
||||
|
||||
(9^5)=59,049
|
||||
59049*7=4,13,343 (which is only 6 digit number )
|
||||
|
@ -15,7 +15,8 @@ def maximum_digital_sum(a: int, b: int) -> int:
|
||||
1872
|
||||
"""
|
||||
|
||||
# RETURN the MAXIMUM from the list of SUMs of the list of INT converted from STR of BASE raised to the POWER
|
||||
# RETURN the MAXIMUM from the list of SUMs of the list of INT converted from STR of
|
||||
# BASE raised to the POWER
|
||||
return max(
|
||||
[
|
||||
sum([int(x) for x in str(base ** power)])
|
||||
|
Reference in New Issue
Block a user