mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
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:
@ -39,17 +39,17 @@ def is_prime(k: int) -> bool:
|
||||
|
||||
def solution(a_limit: int, b_limit: int) -> int:
|
||||
"""
|
||||
>>> solution(1000, 1000)
|
||||
-59231
|
||||
>>> solution(200, 1000)
|
||||
-59231
|
||||
>>> solution(200, 200)
|
||||
-4925
|
||||
>>> solution(-1000, 1000)
|
||||
0
|
||||
>>> solution(-1000, -1000)
|
||||
0
|
||||
"""
|
||||
>>> solution(1000, 1000)
|
||||
-59231
|
||||
>>> solution(200, 1000)
|
||||
-59231
|
||||
>>> solution(200, 200)
|
||||
-4925
|
||||
>>> solution(-1000, 1000)
|
||||
0
|
||||
>>> solution(-1000, -1000)
|
||||
0
|
||||
"""
|
||||
longest = [0, 0, 0] # length, a, b
|
||||
for a in range((a_limit * -1) + 1, a_limit):
|
||||
for b in range(2, b_limit):
|
||||
|
Reference in New Issue
Block a user