Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions python/Arrays/Maximum_sum_path_array.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Python program to find maximum sum path

# This function returns the sum of elements on maximum path from
# beginning to end
# This function returns the sum of elements on maximum path from
#beginning to end


def maxPathSum(ar1, ar2, m, n):
Expand All @@ -12,7 +12,7 @@ def maxPathSum(ar1, ar2, m, n):
# Initialize result and current sum through ar1[] and ar2[]
result, sum1, sum2 = 0, 0, 0

# Below 3 loops are similar to merge in merge sort
# Below three loops are similar to merge in merge sort
while (i < m and j < n):

# Add elements of ar1[] to sum1
Expand Down Expand Up @@ -60,4 +60,4 @@ def maxPathSum(ar1, ar2, m, n):
n = len(ar2)

# Function call
print "Maximum sum path is", maxPathSum(ar1, ar2, m, n)
print "Maximum sum path is", maxPathSum(ar1, ar2, m, n)