2498.cpp (233B)
1 class Solution { 2 public: 3 int maxJump(const vector<int> &stones) { 4 int res = stones[1]; 5 for (int i = 2; i < stones.size(); i++) 6 res = max(res, stones[i] - stones[i - 2]); 7 return res; 8 } 9 };