diff --git a/Algorithms.hpp b/Algorithms.hpp index 6c1aa78..a0d869c 100644 --- a/Algorithms.hpp +++ b/Algorithms.hpp @@ -347,6 +347,9 @@ std::vector getAllFib(const T num){ fibList.push_back(tempNums[cnt % 3]); } + //If you triggered the exit statement you have one more element than you need + fibList.pop_back(); + //Return the vector that contains all of the Fibonacci numbers return fibList; }