Optimized recursive_bubble_sort (#2410)
* optimized recursive_bubble_sort
* Fixed doctest error due whitespace
* reduce loop times for optimization
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@@ -23,8 +23,7 @@ def solution(n):
|
||||
product = -1
|
||||
d = 0
|
||||
for a in range(1, n // 3):
|
||||
"""Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c
|
||||
"""
|
||||
"""Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c"""
|
||||
b = (n * n - 2 * a * n) // (2 * n - 2 * a)
|
||||
c = n - a - b
|
||||
if c * c == (a * a + b * b):
|
||||
|
||||
Reference in New Issue
Block a user