From 35c99662ed54a6de2ede75ad2b77801a90f0364c Mon Sep 17 00:00:00 2001 From: Rakshaa Viswanathan <46165429+rakshaa2000@users.noreply.github.com> Date: Tue, 1 Sep 2020 00:12:43 +0530 Subject: [PATCH] Fixed warnings --- greedy_algorithms/jumpgame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/greedy_algorithms/jumpgame.cpp b/greedy_algorithms/jumpgame.cpp index 2c33b9141..25c6f1c05 100644 --- a/greedy_algorithms/jumpgame.cpp +++ b/greedy_algorithms/jumpgame.cpp @@ -6,9 +6,9 @@ Determine if you are able to reach the last index.*/ #include #include using namespace std; -bool canJump(vector& nums) { +bool canJump(vector nums) { int lastPos = nums.size() - 1; - for (int i = nums.size() - 1; i >= 0; i--) { + for (auto i = nums.size() - 1; i >= 0; i--) { if (i + nums[i] >= lastPos) { lastPos = i; }