Frog Jump problem. What's wrong with my code?

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;

}
}

hey @v13verma if your doubt is stilll not cleared you can ask them in ask doubt section of your course.