SHARE
TWEET

Untitled

a guest Feb 20th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private static int max(int[] array){
  2.         int max = 0;
  3.         for(int i = 0; i<array.length; i++){
  4.             if(array[i]>max){
  5.                 max = array[i];
  6.             }
  7.         }
  8.         return max;
  9.     }
  10.    
  11.     private static int[] diffs(int[] array){
  12.         int[] diffs = new int[array.length-1];
  13.         int diff = 0;
  14.         for(int i =0;i+1<array.length;i++){
  15.             diff = array[i+1]-array[i];
  16.             diffs[i]=diff;
  17.         }
  18.         return diffs;
  19.     }
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