zero-indexed array A consisting of N integers is given. A triplet (P, Q, R) is triangular if and
A[P] + A[Q] > A[R], A[Q] + A[R] > A[P], A[R] + A[P
Sorting would be very cool, but const vector and O(1) space requirements doesn't allow it.
(because this is homework) Some hint: triangular numbers are close to each other.