Skip to content

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
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Can you use complexity to explain why your implementations are better than the originals?

Copy link

Choose a reason for hiding this comment

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

The indentation and spacing of the code in this file is a bit off. Can you improve the formatting of the code?

@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 Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants