diff --git a/greedy_algorithms/jumpgame.cpp b/greedy_algorithms/jumpgame.cpp index 60b7edd35..7699abdc7 100644 --- a/greedy_algorithms/jumpgame.cpp +++ b/greedy_algorithms/jumpgame.cpp @@ -6,7 +6,7 @@ Determine if you are able to reach the last index.*/ #include #include -bool canJump(vector nums) { +bool canJump(std::vector nums) { auto lastPos = nums.size() - 1; for (auto i = nums.size() - 1; i >= 0; i--) { if (i + nums[i] >= lastPos) { @@ -16,8 +16,9 @@ bool canJump(vector nums) { return lastPos == 0; } -void main(){ +int main(){ //Sample test case - vector num={4,3,1,0,5}; + std::vector num={4,3,1,0,5}; cout<