From 331638065c31aaa8b36613352ffd30072b694836 Mon Sep 17 00:00:00 2001 From: Rakshaa Viswanathan <46165429+rakshaa2000@users.noreply.github.com> Date: Tue, 1 Sep 2020 00:15:34 +0530 Subject: [PATCH] Fixed bug and removed namespace std --- 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 25c6f1c05..60b7edd35 100644 --- a/greedy_algorithms/jumpgame.cpp +++ b/greedy_algorithms/jumpgame.cpp @@ -5,9 +5,9 @@ Determine if you are able to reach the last index.*/ #include #include -using namespace std; + bool canJump(vector nums) { - int lastPos = nums.size() - 1; + auto lastPos = nums.size() - 1; for (auto i = nums.size() - 1; i >= 0; i--) { if (i + nums[i] >= lastPos) { lastPos = i;