Closed overinvest closed 2 months ago
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!
Description of Change
Using a vector to store Fibonacci numbers: Instead of using two strings
fibMinus1
andfibMinus2
to store the last two Fibonacci numbers, we used a vector. This made it possible to simplify the code and make it more readable.Optimization of the addition function: Instead of adding zeros to a shorter string, we just took this into account in the addition cycle, checking if the index is out of line.
Using
std::string::push_back
andstd::string::insert
: Instead of concatenating strings, we usedpush_back
andinsert
to add characters and strings. It's more efficient in terms of performance.Using
std::to_string
to convert numbers to strings: Instead of complex conversion of numbers to strings using ASCII codes, we usedstd::to_string
.Checklist
Notes: Optimized the Fibonacci calculation algorithm for better performance and readability.