-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython014.py
More file actions
51 lines (30 loc) · 823 Bytes
/
Copy pathpython014.py
File metadata and controls
51 lines (30 loc) · 823 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class Difference:
def __init__(self, a):
self.maximumDifference = 0
self.__elements = a
# Add your code here
def computeDifference(self):
min = self.__elements[0]
max = self.__elements[0]
for el in self.__elements:
if(el>max):max = el
elif(el<min):min = el
self.maximumDifference = max-min
return self.maximumDifference
# End of Difference class
# The absolute difference between two integers
_ = input()
a = [int(e) for e in input().split(' ')]
d = Difference(a)
d.computeDifference()
print(d.maximumDifference)
# def oddNumbers(l, r):
# # Write your code here
# arr = []
# for el in range (l,r+1):
# if(el%2!=0):
# arr.append(el)
# return arr
# l=3
# r=9
# print(oddNumbers(l, r))