Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 287 Bytes

File metadata and controls

10 lines (8 loc) · 287 Bytes

Given an array containing n integers. The problem is to find the sum of the elements of the contiguous subarray having the smallest(minimum) sum.

Input : arr[] = {3, -4, 2, -3, -1, 7, -5}
Output : -6
Subarray is {-4, 2, -3, -1} = -6

Input : arr = {2, 6, 8, 1, 4}
Output : 1