Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 21, 2024
1 parent 8a3367b commit e0462f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data_structures/arrays/kadane_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
def kadanes_algorithm(arr):
# Initializing variables
max_current = arr[0] # This will store the current max sum
max_global = arr[0] # This will store the global max sum
max_global = arr[0] # This will store the global max sum

# Loop through the array starting from the second element
for i in range(1, len(arr)):
Expand All @@ -16,6 +16,7 @@ def kadanes_algorithm(arr):

return max_global


# Example usage
arr = [-2, 1, -3, 4, -1, 2, 1, -5, 4]
result = kadanes_algorithm(arr)
Expand Down

0 comments on commit e0462f0

Please sign in to comment.