ZA | 25-SDC-July | Faith Muzondo | Sprint 2 | improve with precomputing#55
ZA | 25-SDC-July | Faith Muzondo | Sprint 2 | improve with precomputing#55Faithy4444 wants to merge 1 commit intoCodeYourFuture:mainfrom
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.
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.
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