SHARE
TWEET

Untitled

a guest Feb 12th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for(int i = 0; i < n-k+1; i++){    
  2.     int current_sum = 0;
  3.      
  4.     for(int j = 0; j < k; j++){        
  5.         current_sum = current_sum + arr[i+j];        
  6.     }
  7.     max_sum = max(current_sum, max_sum);    // pick maximum sum
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top