Skip to content

Comments

WestMidlands| SDC NOV 2025 | Sara Tahir | Sprint 2 |Improve with precomputing#120

Open
SaraTahir28 wants to merge 2 commits intoCodeYourFuture:mainfrom
SaraTahir28:feature/improvewithPrecomputing
Open

WestMidlands| SDC NOV 2025 | Sara Tahir | Sprint 2 |Improve with precomputing#120
SaraTahir28 wants to merge 2 commits intoCodeYourFuture:mainfrom
SaraTahir28:feature/improvewithPrecomputing

Conversation

@SaraTahir28
Copy link

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

Changelist

Common prefixes
In the original implementation we compared every pair of strings, which is O(n²). By sorting the list first, strings with similar prefixes become adjacent, so we only need to compare neighbouring pairs. This reduces the complexity to O(n log n)

Count Letters
I have Precomputed lowercase and uppercase character sets to avoid repeated full‑string scans.
This reduces count_letters from O(n²) to O(n).

Questions

I have no Questions. Thankyou.

@SaraTahir28 SaraTahir28 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 23, 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