Problem Description
A = [2, 8, 4, 1]Input 2:
A = [2, 2, 4, 2]
2Output 2:
6
The triplets {4, 1, 3}, {1, 3, 2} form a GP.For Input 2:
All the permutations of {1, 2, 4} form a GP.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.