Find the biggest difference pair in the list



Problem to find the biggest difference pair in the list.



Example-1:


Input    : n = [ 5, 9, 7, 3, 2, 8]
Output   : (2, 9) (9, 2)
Explain  : These pairs are biggest difference in the list.   


Example-2:


Input    : n = [ 4, 6, 7, 5, 12, 45, 9]
Output   : (4,45) (45,4)
Explain  : These pairs are biggest difference in the list.   







Solution





n = [ 5, 9, 7, 3, 2, 8]

x = (min(n),max(n))

y = (max(n),min(n))

print(x,y)



Output



(2, 9) (9, 2)