-
Notifications
You must be signed in to change notification settings - Fork 0
improve fibonacchi examples [change in title] #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
/add_docs main.py |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨Explore these optional code suggestions:
|
/custom_prompt
|
Custom Prompt Suggestions 🎨
|
def nth_fibonacci(n): | ||
if n <= 1: | ||
return n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Add input validation checks
def nth_fibonacci(n): | |
if n <= 1: | |
return n | |
def nth_fibonacci(n): | |
if not isinstance(n, int): | |
raise TypeError("Input must be an integer") | |
if n < 0: | |
raise ValueError("Input must be non-negative") | |
if n <= 1: | |
return n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only positive integers in test cases so no need to these checks
/update_changelog |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. Changelog updates: 🔄 [2025-02-20][https://github.com//pull/1]Changed
|
new comment on this pr |
result = nth_fibonacci(n) | ||
print(result) | ||
|
||
|
||
# Function to calculate the nth Fibonacci number using memoization | ||
def nth_fibonacci_util(n, memo): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review comment
comment |
hello |
comment |
PR Type
enhancement
Description
Replaced recursive Fibonacci implementation with an iterative approach.
Added a new Fibonacci function using memoization for efficiency.
Improved code readability and performance for Fibonacci calculations.
Changes walkthrough 📝
main.py
Enhanced Fibonacci implementations with iterative and memoization
methods
main.py