Count the number of possible triangles
You are given an array of positive integers, where each value is the length of a candidate side. Count how many ways you can pick three different positions `i < j < k` so that the three chosen lengths can form a non-degenerate (strictly positive area) triangle.