London | 25-SDC-July | Fatma Arslantas | Sprint 2 | Improve code with precomputing#77
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
How do you know your solutions are better?
|
Hi @cjyuan, Thank you for the feedback! For your question, I thought my solution is better for two reasons: First, I analysed the old version that used nested loops (loops inside loops). I tried to improve this by using Sets and Sorting so the code doesn't need to check the same things repeatedly. And second, I ran the tests locally, and the heavy tests finished in 8 seconds. The old code would take much longer or freeze with that amount of data. Do you think this logic is right? |
|
You were in the right direction. A more convincing proof would be to compare their complexity using the big-O notations. |
|
Closing PR because the SDC run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
I optimised
common_prefixandcount_lettersusing Precomputing techniques.Questions
I don’t have any questions, thank you!