-
-
Notifications
You must be signed in to change notification settings - Fork 14
ZA | 25-SDC-July | Faith Muzondo | Sprint 2 | improve with precomputing #55
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?
ZA | 25-SDC-July | Faith Muzondo | Sprint 2 | improve with precomputing #55
Conversation
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
1 similar comment
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
OracPrime
left a comment
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.
Count letters is good, but you've massively over-complicated the prefix task
| n = len(strings) | ||
| for i in range(n): | ||
| for j in range(i + 1, n): | ||
| # Compare prefixes of strings[i] and strings[j] efficiently |
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 think you've managed to make this considerably less efficient by computing more!
There is a much simpler way to solve this problem, and you certainly don't need to extract all possible prefixes.
Consider what benefit you might get from sorted the list of strings first.
Self checklist