Untitled
unknown
plain_text
3 years ago
370 B
5
Indexable
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 ;
}Editor is loading...