Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
370 B
0
Indexable
Never
public int solve(ArrayList<Integer> A) {
        if(A.size()<=1) {
            return 0;
        }
        long output =1;
        for(int i=1;i<A.size();i++) {
            if(A.get(i)>A.get(i-1)) {
                output =  ((output * (A.get(i)% (long)(Math.pow(10,9)+7)))% (long)(Math.pow(10,9)+7));
            }
        }
        
        return (int) output ;
    }