Question: 
Write a function to find the sum of maximum increasing subsequence of the given array.


Model's Code:
def max_sum_increasing_subsequence(arr, n):
    if n == 0:
        return 0
    max_sum = arr[:]  # Initialize max_sum array with the original array values
    for i in range(1, n):
        for j in range(i):
            if arr[i] > arr[j] and max_sum[i] < max_sum[j] + arr[i]:
                max_sum[i] = max_sum[j] + arr[i]
    return max(max_sum)



Sample Correct Code:
def max_sum_increasing_subsequence(arr, n): 
	max = 0
	msis = [0 for x in range(n)] 
	for i in range(n): 
		msis[i] = arr[i] 
	for i in range(1, n): 
		for j in range(i): 
			if (arr[i] > arr[j] and
				msis[i] < msis[j] + arr[i]): 
				msis[i] = msis[j] + arr[i] 
	for i in range(n): 
		if max < msis[i]: 
			max = msis[i] 
	return max


Asserts:
assert max_sum_increasing_subsequence([1, 101, 2, 3, 100, 4, 5], 7) == 106
assert max_sum_increasing_subsequence([3, 4, 5, 10], 4) == 22
assert max_sum_increasing_subsequence([10, 5, 4, 3], 4) == 10


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 524 of 974: 387/524 (73.85496183206108%): success