Given an array Arr of N numbers, you need to write a program to find the first digit(from left side) of product of these N integers.
First line of input contains an integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains a single integer N which denotes the number of elements in the array. Second line of each test case contains N space separated integers which denotes the elements of the array.
For each test case, in a new line, print the first digit of product of these N integers present in the array.
1 <= T <= 100
1 <= N <= 104
1 <= Arr[i] <= 105
5 8 3 7
6 7 9
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.