There are n soldiers standing in a line. Each soldier is assigned a unique rating value, represented by an integer array rating.
A team is composed of i, j, and k with
rating[i] rating[j] rating[k]
rating[i] rating[j] rating[k]
Return the total number of teams that can be formed according to these rules.
Constraints:
n == rating.length
n
rating[i]
All the integers in rating are unique.
There are n soldiers standing in a line. Each soldier is assigned a unique rating value, represented by an integer array rating.
A team is composed of i, j, and k with
rating[i] rating[j] rating[k]
rating[i] rating[j] rating[k]
Return the total number of teams that can be formed according to these rules.
Constraints:
n == rating.length
n
rating[i]
All the integers in rating are unique.