For this Question: Given an array A of N integers. Compute the product of all of its elements. If the product exceeds 10<sup>18</sup>, return -1 instead.Since this will be a functional problem, you don't have to take input. You have to complete the function <b>findProduct()</b> that takes an ArrayList A as a parameter.

<b>Constraints</b>
1<=N<=10<sup>5</sup>
0<=A<sub>i</sub><=10<sup>18</sup>Return the product if it is less than or equal to 10<sup>18</sup. In all other cases, return -1.Sample Input:
10 5 3 2

Sample Output:
300, I have written this Solution Code: 
 
class Solution {
    public long findProduct(ArrayList<Long> A) {
        long ans = 1;
        for (long a : A) {
            if (a == 0) {
                ans = 0;
                break;
     
            } else if (a > (long)Math.pow(10, 18)/ans) {
                ans = -1;
            } else {
                ans *= a;
            }
        }
        return ans;
    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?