kadane's algorithm
public int kadane(int[] arr){
int max_so_far = 0, curr_max = Integer.MIN_VALUE;
for(int i: arr){
max_so_far += i;
if(max_so_far<0) max_so_far = 0;
if(max_so_far>curr_max) curr_max = max_so_far;
}
return curr_max;
}
Also in C:
- powershell search big files
- meaning of &variable c
- warning: function returns address of local variable [-Wreturn-local-addr]
- lazer codechef
- RuntimeError: You must setup() the GPIO channel first
- fgets langage c
- 32bit or 64bit
- print digits of a number in c
- esp32 dhcp server
- how to create random integers from a specific range in c language
- Declare macro
- matplotlib pyplot legend location
- addition of two numbers in c
- how to add to the end of a linked list
- check if string in string c
- keras conv2d batchnorm
- intellij idea
- Route::resource
- calloc
- android is not recognized
- select all file from date powershell
- wireshark tls client hello filter
- #pragma pack(1) in c
- get configuration script window 7