Count Possible Triangles
easy
Given an unsorted array arr[] of n positive integers. Find the number of triangles that can be formed with three different array elements as lengths of three sides of triangles.
Constraints
3 <= n <= 10^3 1 <= arr[i] <= 10^3
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
5
6 4 9 7 8
Sample Output
10