Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
cjyuan
left a comment
There was a problem hiding this comment.
Code looks good.
Could you use complexity to explain how the new implementation is better than the original implementation?
|
|
What about the complexity of original and the improved |
The improved implementation has a time complexity of O(n log n × m) because it sorts the strings first and then compares only neighbouring strings. Both implementations use O(n + m) extra space. Overall, the improved implementation is more efficient because it reduces the number of string comparisons, especially when working with large lists of @cjyuan |
|
All good. |
Learners, PR Template
Self checklist
Task code
CYF-1183
Changelist