<std::
size_tSIZE>
30int64_t current_max = INT_MIN, current_sum = 0;
31 for(
inti = 0; i < length; i++) {
32current_sum = current_sum + arr[i];
33 if(current_max < current_sum) {
34current_max = current_sum;
37 if(current_sum < 0) {
49std::array<int64_t, 4> arr = {1, 2, 3, 4};
50std::array<int64_t, 5> arr1 = {-1, -2, -4, -6, 7};
53std::cout <<
"All test cases have passed!\n";
int max_subarray_sum(std::array< int64_t, SIZE > arr, uint64_t length)
for IO operations
static void test()
Self-test implementations.
int main()
Main function.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4