An list 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].
Where P, Q and R are distinct elements. For example, consider listA such that:
A[0]=10 A[1]=2 A[2]=5
A[3]=1 A[4]=8 A[5]=20
Triplet (0, 2, 4) is triangular.
Write a function def triangular(A) that, given a list Aconsisting of N integers, if there exists a triangular tripletreturns a list containing triangular triplet or returns None ifthere is no triangular triplet. If there is more than onetriangular triplet, the first
PayPal Gateway not configured
PayPal Gateway not configured