Triangle: Determine if an array includes a triangular triplet (Codility)
问题 This is the Triangle problem from Codility: A zero-indexed array A consisting of N integers is given. A triplet (P, Q, R) is triangular if 0 ≤ P < Q < R < N and: A[P] + A[Q] > A[R], A[Q] + A[R] > A[P], A[R] + A[P] > A[Q]. Write a function: int solution(vector<int> &A); that, given a zero-indexed array A consisting of N integers, returns 1 if there exists a triangular triplet for this array and returns 0 otherwise. For example, given array A such that: A[0] = 10, A[1] = 2, A[2] = 5, A[3] = 1,