-
-
Notifications
You must be signed in to change notification settings - Fork 47k
added iterative solution for product sum problem #11133
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: master
Are you sure you want to change the base?
Conversation
Signed-off-by: negi153 <mukesh7758negi@gmail.com>
@cclauss Could you or someone please review it . |
Please add a |
Signed-off-by: mukeshsingh.negi@infosys.com <mukesh7758negi@gmail.com>
Hi @cclauss , as you suggested i have added benchmarking. Kindly take a look at this. |
Signed-off-by: mukeshsingh.negi@infosys.com <mukesh7758negi@gmail.com>
Hi @cclauss any update on this ? |
product sum = 18 (previous) + (-13) * 6 + 8 * 6 = -12 | ||
------------------------------------------------------- | ||
|
||
Examples: |
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.
Both functions need to be tested with the SAME doctests and produce the SAME results.
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.
@cclauss I have updated the doctest. kindly check
Describe your change:
This contribution includes an iterative approach to solve product sum problem.
Recursion may run into Stack overflow if array has many nested arrays but iterative approach won't run into this problem.
Checklist: