Need guidance in finding the source for the following question or any type of approach to solve it..

Правка en2, от kotadiyameet173, 2025-01-13 07:09:01

You are given two arrays of size n. You need to choose the sub-array from the first array and replace it with a corresponding sub-array from the second array. Now, find the maximum consecutive sub-array sum in the modified first array.

Sample Input 1-

2

4 -2

1 2

Sample Output 1-

6

Sample Input 2-

8

-2 2 -3 1 -1 -1 1 0

4 -3 3 3 2 -5 3 4

Sample Output 2-

12

Теги array, maximum subarray sum, kadane

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский kotadiyameet173 2025-01-13 07:09:01 40
en1 Английский kotadiyameet173 2025-01-13 07:07:57 486 Initial revision (published)