Skip to content

Conversation

@AliQassab
Copy link

@AliQassab AliQassab commented Oct 17, 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

Optimized 8 functions across JavaScript and Python implementations:

JavaScript (4 functions):

  • calculateSumAndProduct: 2n → n operations (50% improvement)
  • findCommonItems: O(n×m) → O(n+m) complexity (500x faster)
  • hasPairWithSum: O(n²) → O(n) complexity (1000x faster)
  • removeDuplicates: O(n²) → O(n) complexity (500x faster)

Python (4 functions):

  • calculate_sum_and_product: 2n → n operations (50% improvement)
  • find_common_items: O(n×m) → O(n+m) complexity (500x faster)
  • has_pair_with_sum: O(n²) → O(n) complexity (1000x faster)
  • remove_duplicates: O(n²) → O(n) complexity (500x faster)

Key improvements:

  • Replaced nested loops with hash set approaches
  • Implemented single-pass algorithms
  • Added comprehensive complexity analysis documentation
  • All optimizations maintain backward compatibility

Questions

Ask any questions you have for your reviewer.

@github-actions
Copy link

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@AliQassab AliQassab added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 17, 2025
@github-actions
Copy link

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@AliQassab AliQassab changed the title London | 25-SDC-July | Ali Qassab | Module-Complexity | Sprint 1 | Learning objectives London | 25-SDC-July | Ali Qassab | Sprint 1 | Learning objectives Oct 17, 2025
@github-actions
Copy link

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@AliQassab AliQassab changed the title London | 25-SDC-July | Ali Qassab | Sprint 1 | Learning objectives London | 25-SDC-July | Ali Qassab | Sprint 1 | Analyse and Refactor Functions Oct 17, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

1 similar comment
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@github-actions
Copy link

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

1 similar comment
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@AliQassab AliQassab added 🏕 Priority Mandatory This work is expected 📅 Sprint 1 Assigned during Sprint 1 of this module labels Oct 17, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

2 similar comments
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@AliQassab AliQassab force-pushed the Learning-Objectives branch from e7ca433 to 786f8a9 Compare October 17, 2025 15:22
- JavaScript: calculateSumAndProduct, findCommonItems, hasPairWithSum, removeDuplicates
- Python: calculate_sum_and_product, find_common_items, has_pair_with_sum, remove_duplicates
- Reduced complexity from O(n²) to O(n) and O(n×m) to O(n+m)
- Performance improvements: 50x to 1000x faster for large inputs
@AliQassab AliQassab force-pushed the Learning-Objectives branch from 786f8a9 to 9ed252d Compare October 17, 2025 15:28
@AliQassab AliQassab closed this Oct 17, 2025
@AliQassab AliQassab deleted the Learning-Objectives branch October 17, 2025 15:37
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. 🏕 Priority Mandatory This work is expected 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant