You are viewing a single comment's thread. Return to all comments →
Java Solution :
Difference(int[] a){ this.elements = a; } void computeDifference(){ for(int i=0; i<elements.length-1; i++){ for(int j=i+1; j<elements.length; j++){ int diff = Math.abs(elements[i]-elements[j]); if(diff > maximumDifference){ this.maximumDifference = diff; } } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 14: Scope
You are viewing a single comment's thread. Return to all comments →
Java Solution :