Skip to content

Manchester | 26-SDC-Jun | Fithi Teklom | Sprint 1 | Analyse And Refactor Functions - #259

Open
Fithi-Teklom wants to merge 1 commit into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/analyse-and-refactor
Open

Fithi-Teklom wants to merge 1 commit into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/analyse-and-refactor

Conversation

@Fithi-Teklom

Copy link
Copy Markdown

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

Task code

CYF-1173

Changelist

Refactored Sprint 1 exercises to improve efficiency by reducing time complexity where possible. All tests pass.

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

Refactor code and complexity analyses look good. Well done.

Comment on lines +13 to +20
const secondSet = new Set(secondArray);
const commonItems = new Set();

for (const item of firstArray) {
if (secondSet.has(item)) {
commonItems.add(item);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note:
Most Set implementations support the common set operations such as union, intersection, difference, subset, superset, equality, add, remove, contains, size, clear, and is empty.
You could consider taking advantage of them for optimal performance.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants