Skip to content

Sheffield | 25-SDC-Nov | Hassan Osman | Sprint 1 | Analyse and Refactor Functions#122

Open
HassanOHOsman wants to merge 19 commits intoCodeYourFuture:mainfrom
HassanOHOsman:refactor/reduce-complexity
Open

Sheffield | 25-SDC-Nov | Hassan Osman | Sprint 1 | Analyse and Refactor Functions#122
HassanOHOsman wants to merge 19 commits intoCodeYourFuture:mainfrom
HassanOHOsman:refactor/reduce-complexity

Conversation

@HassanOHOsman
Copy link

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

In this pull request, I analysed the functions in the exercises and explained their time complexity, space complexity, and optimal time complexity using Big O notation. I then refactored the code to improve efficiency and reduce complexity, using both JavaScript and Python.

…second number (difference between target and first number)
…oid scanning through each element in an array which is not efficient.
…the set. if not it gets added to the set of unique numbers
…ay since order matters. Also, once element is checked it gets added to the set to to avoid duplication as checking goes ahead
…ers found in both arrays (1&2) are stored in uniqueCommonItems
@HassanOHOsman HassanOHOsman added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 1 Assigned during Sprint 1 of this module labels Feb 26, 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. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant