Python - Check from how many combinations in a list you can create a triangle : I'm writing a PYTHON program that returns out of how many combinations in a list you can create a triangle.

EXAMPLE:

--> test([1,1,3])
0 #you cant make a triangle out of 1,1,3 (the only combination in this list)

--> test([2,789,5,3,3237,4])
3 #you can make a triangle out of [2,5,4],[5,3,4] and [2,4,3]

ANY HELP IS APPRECIATED
