Question: Use python 3 pls 3. Triplets Given an array of n distinct integers, d = (d[0], d[1].... dn-1), and an integer threshold, t, how many
Use python 3 pls
3. Triplets Given an array of n distinct integers, d = (d[0], d[1].... dn-1), and an integer threshold, t, how many (a, b, c) index triplets exist that satisfy both of the following conditions? d[a] integer threshold t = 8 size of d[) n = 5 d = [1, 2, 3, 4, 6) 1 OWNEU 00 3 4 Sample Output 3 Explanation Given t = 8 and d =(1, 2, 3, 4, 6), the following triplets satisfy the conditions: 1.(0,1,2) 1+2+358 2. (0.1.3) 1+2+458 3. (0, 2, 3) 1+3+458 Sample Case 1 STDIN Function Integer threshold t = 8 size of d[] n = 5 d = (1, 2, 3, 4, 6) > 2 Sample Output Explanation Given t = 8 and d = [1, 2, 3, 4, 6), the following triplets satisfy the conditions: 1.(0, 1, 2) 1+2+358 2. (0,1.3) 1+ 2+ 458 3. (0,2,3) 1+3+458 Sample Case 1 Sample Input STDIN Function integer threshold t = 7 size of dc) n = 4 d = (3, 1, 2, 41 MN Sample Output 2 Explanation Given t = 7and d=13, 1, 2, 4], the following triplets satisfy the conditions: 1.(1,2,0) - 1+2+357 2. (1.23) 1+2+457