forked from sat5297/hacktober-coding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScope.java
More file actions
33 lines (29 loc) · 737 Bytes
/
Scope.java
File metadata and controls
33 lines (29 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
class Difference {
private int[] elements;
public int maximumDifference;
// Add your code here
Difference(int[] elements)
{
this.elements = elements;
}
public void computeDifference(){
int m = 0;
for(int i =0; i<elements.length ;i++)
{
for(int j=0;j<elements.length;j++)
{
int a = Math.abs(elements[i] - elements[j]);
if(a>m)
{
m = a;
}
}
}
maximumDifference = m;
}
} // End of Difference class