Skip to content

WestMidlands | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Analyse and Refactor Functions#179

Open
JanefrancessC wants to merge 4 commits into
CodeYourFuture:mainfrom
JanefrancessC:sprint1
Open

WestMidlands | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Analyse and Refactor Functions#179
JanefrancessC wants to merge 4 commits into
CodeYourFuture:mainfrom
JanefrancessC:sprint1

Conversation

@JanefrancessC

@JanefrancessC JanefrancessC commented Jun 24, 2026

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

Refactor and analyse functions based on Time and Space complexities.

@github-actions

This comment has been minimized.

@JanefrancessC JanefrancessC added 📅 Sprint 1 Assigned during Sprint 1 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 Jun 24, 2026
@github-actions

This comment has been minimized.

1 similar comment
@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 Jun 24, 2026
@github-actions

This comment has been minimized.

@JanefrancessC JanefrancessC changed the title Birmingham | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Refactor and Analyse code Birmingham | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Analyse and Refactor Functions Jun 24, 2026
@github-actions

This comment has been minimized.

@JanefrancessC JanefrancessC added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@github-actions

This comment has been minimized.

@JanefrancessC JanefrancessC changed the title Birmingham | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Analyse and Refactor Functions WestMidland | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Analyse and Refactor Functions Jun 24, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@JanefrancessC JanefrancessC added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 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 Jun 24, 2026
@JanefrancessC JanefrancessC changed the title WestMidland | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Analyse and Refactor Functions WestMidlands | 26-SDC-Mar | Chioma Okeke | Sprint 1 | Analyse and Refactor Functions Jun 24, 2026
@JanefrancessC JanefrancessC added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 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.

Both code and complexity analysis are good. Well done.

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

return [...new Set(firstArray.filter((item) => secondSet.has(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.

Could also take advantage of Set's built-in methods to find common items between two sets.

Comment on lines +15 to 20
for (const item of inputSequence) {
if (!seenItems.has(item)) {
seenItems.add(item);
result.push(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.

Could also take advantage of how Set and Array could be converted from one another to simplify the code.

@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 Jun 25, 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. Module-Complexity The name of the module. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants