Problem Statement:
Mark wants to find the triple factorial of a given number N.
A triple factorial of a number N is the product of positive numbers less than or equal to that number and congruent to N modulo 3.
It means N!!! = N * (N-3) * (N-6) *... * (x+3) * x, where x is the smallest positive number which is congruent to N modulo 3.
Print the triple factorial for a given number N.
Note:
Function Description:
In the provided code snippet, implement the provided tripleFactorial(...) method to print the triple factorial for a given number N. You can write your code in the space below the phrase "WRITE YOUR LOGIC HERE".
There will be multiple test cases running so the Input and Output should match exactly as provided.
The base Output variable result is set to a default value of -404 which can be modified. Additionally, you can add or remove these output variables.
Input Format:
Sample Test Case:
Input:
10
Expected Output:
280
(Explanation for your understanding: 10*7*4*1 = 280)