Fixed bug in getNumFib where you get one number larger than desired

This commit is contained in:
2019-02-28 11:22:58 -05:00
parent 7bd89b9479
commit ccebe26aa2

View File

@@ -347,6 +347,9 @@ std::vector<T> 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;
}