
The first line contains ‘T’, denoting the number of test cases.
Each test case contains a single integer ‘N’, denoting the number of elements given to Ninja.
The next line contains the ‘N’ elements given to Ninja.
For each test case, return an integer denoting the sum of numbers divisible by 2 or 3.
You are not required to print the expected output. It has already been taken care of. Just implement the function.
1 <= T <= 10
1 <= N <= 10^3
0 <= input[i] <= 10^3
Where ‘T’ denotes the number of test cases and ‘N’ is the elements given to Ninja and input[i] denotes theith input.
Time Limit: 1 sec
The key here is to traverse all the elements in the given array and check whether it is divisible by 2 or 3, and simultaneously add the value to the sum.
The steps are as follows: