Skip to content

Conversation

@Luke-Manyamazi
Copy link

@Luke-Manyamazi Luke-Manyamazi commented Nov 10, 2025

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

  • calculateSumAndProduct (JS): Optimized from two sequential O(N) loops to a single O(N) loop, reducing array traversals by 50%.
  • findCommonItems (JS): Reduced time complexity from O(N * M) to O(N + M) by using a Set for O(1) average-time lookups.
  • has_pair_with_sum (Python): Reduced time complexity from O(N^2) to O(N) by using a hash set to track complements.
  • remove_duplicates (Python): Reduced time complexity from O(N^2) to O(N) by using a hash set to track seen items while preserving order.

Questions

  1. Readability vs. Conciseness (JS findCommonItems): I provided both a detailed, multi-line refactor and a concise one-line version for findCommonItems using the Set object. Which style is preferred for functions of this nature in our codebase?

@Luke-Manyamazi Luke-Manyamazi 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 Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Complexity The name of the module. 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