Skip to content

Glasgow | 26-SDC-Mar | Mohammed Abdoon | Sprint 2 | Improve With Precomputing - #220

Open
M-Abdoon wants to merge 1 commit into
CodeYourFuture:mainfrom
M-Abdoon:sprint2/improve_with_precomputing
Open

Glasgow | 26-SDC-Mar | Mohammed Abdoon | Sprint 2 | Improve With Precomputing#220
M-Abdoon wants to merge 1 commit into
CodeYourFuture:mainfrom
M-Abdoon:sprint2/improve_with_precomputing

Conversation

@M-Abdoon

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

@M-Abdoon M-Abdoon added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Complexity The name of the module. labels Jul 16, 2026
@M-Abdoon M-Abdoon changed the title Glasgow | 26-SDC-Mar | Mohammed Abdoon| Sprint 2 | Improve With Precomputing Glasgow | 26-SDC-Mar | Mohammed Abdoon | Sprint 2 | Improve With Precomputing Jul 16, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also use complexity to explain how the new implementation is better than the original implementation?

Comment on lines +13 to +20
sorted_strings = sorted(strings)
first = sorted_strings[0]
last = sorted_strings[-1]
min_length = min(len(first), len(last))
i = 0
while i < min_length and first[i] == last[i]:
i += 1
return first[:i]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is expected to return the longest common prefix among all strings in the given array.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Complexity The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants