PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from random import randint as wow
arr,count=[],0
n,max=int(input('')),int(input(''))
for i in range(0,n):
arr.append(wow(0,max+1))
print(arr,"\n")
for i in range(0,len(arr)-1):
for j in range(i+1,len(arr)):
if(arr[i]>arr[j]):
print(arr[i],"-",arr[j])
count+=1
print("There are ",count," inverse-pairs.")
## AUTHOR-- $@¥@N €H@NDR@
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run