Count Triplets

  • + 0 comments

    Things to consider for this problem:

    • Overflows when multiplying the numbers
    • With the indices i < j < k, the numbers must be non-descending (e.g. 1, 4, 2 should not be considered a triplet). You can't just pick the three numbers from anywhere in the array.
    • The "corner case" with r = 1