From 5e30e7eb640c01c8e8e0f7c91059f22c910bd751 Mon Sep 17 00:00:00 2001 From: Rakshaa Viswanathan <46165429+rakshaa2000@users.noreply.github.com> Date: Tue, 15 Sep 2020 12:34:23 +0530 Subject: [PATCH] Update greedy_algorithms/jumpgame.cpp Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com> --- greedy_algorithms/jumpgame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greedy_algorithms/jumpgame.cpp b/greedy_algorithms/jumpgame.cpp index fb7ceb06f..6a2e75840 100644 --- a/greedy_algorithms/jumpgame.cpp +++ b/greedy_algorithms/jumpgame.cpp @@ -23,7 +23,7 @@ * @param array of numbers containing the maximum jump (in steps) from that index * @returns bool value whether final index can be reached or not */ -bool canJump(std::vector nums) { +bool canJump(const std::vector &nums) { auto lastPos = nums.size() - 1; for (auto i = nums.size() - 1; i >= 0; i--) { if (i + nums[i] >= lastPos) {