mirror of
https://bitbucket.org/Mattrixwv/my-classes.git
synced 2025-12-06 18:23:57 -05:00
Fixed bug in getNumFib where you get one number larger than desired
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user