Count of Triplets – Decreasing Order: The program must accept N integers as the input. The program must print the count of triplets where the three integers are in strictly decreasing order among the given N integers as the output.
Note: The order of integers in the triplets must be in the same order as in the input.
3 <= N <= 100
1 <= Each integer value <= 10^5
The first line contains N.
The second line contains N integers separated by a space.
The first line contains the count of triplets where the three integers are in strictly decreasing order among the given N integers.
Example Input/Output 1:
7 2 8 3 1
The 3 triplets are given below.
7 > 2 > 1
7 > 3 > 1
8 > 3 > 1
Example Input/Output 2:
75 82 23 44 81 91 72 24 92
N=int(input()) arr=list(map(int,input().split())) count=0 for ind1 in range(0,N): for ind2 in range(ind1+1,N): for ind3 in range(ind2+1,N): if arr[ind1]>arr[ind2] and arr[ind2]>arr[ind3]: count+=1 print(count)