Q.https://leetcode.com/problems/frog-jump/
class Solution {
public boolean canCross(int[] stones) {
int count=0;
for(int i=2;i<stones.length;i++) {
int k=stones[i-1]-stones[i-2];
if(stones[i]==stones[i-1]+k)continue;
else if(stones[i]==stones[i-1]+k-1)continue;
else if(stones[i]==stones[i-1]+k+1)continue;
else {
count++;
break;
}
}
if(count==1)return false;
return true;
}
}