Skip to content

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 2 | improve_with_precomputing#128

Open
RahwaZeslusHaile wants to merge 1 commit intoCodeYourFuture:mainfrom
RahwaZeslusHaile:improve_with_precomputing
Open

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 2 | improve_with_precomputing#128
RahwaZeslusHaile wants to merge 1 commit intoCodeYourFuture:mainfrom
RahwaZeslusHaile:improve_with_precomputing

Conversation

@RahwaZeslusHaile
Copy link

@RahwaZeslusHaile RahwaZeslusHaile commented Feb 27, 2026

Manchester | 25-SDC-Nov | Rahwa Haile | Sprint 2 | improve_with_precomputing

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

Description

Improves the performance of two algorithms using precomputing strategies without modifying existing tests.

Changelist

Common Prefix:
Pre-sort strings once, then compare only adjacent pairs
Reduces comparisons from O(n²) to O(n log n) sort + O(n) comparisons

Count Letters:
Precompute lowercase letters into a set during the first pass
Replace repeated letter.lower() in s checks with O(1) set lookups
Reduces time complexity from O(n²) to O(n)

I really appreciate the time you take to review this PR

@RahwaZeslusHaile RahwaZeslusHaile added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 27, 2026
@github-actions

This comment has been minimized.

@RahwaZeslusHaile RahwaZeslusHaile added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant