leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
2498.cpp (233B)
0 class Solution {
1 public:
2 int maxJump(const vector<int> &stones) {
3 int res = stones[1];
4 for (int i = 2; i < stones.size(); i++)
5 res = max(res, stones[i] - stones[i - 2]);
6 return res;
7 }
8 };