Skip to content

Glasgow | May 2025 | Salah Ahmed | Data Groups | Sprint 1 #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

avatarit
Copy link

@avatarit avatarit commented Jul 10, 2025

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

I have solved all issues relaed to sprint 1 in Data Group

@avatarit avatarit added Needs Review Participant to add when requesting review 📅 Sprint 1 Assigned during Sprint 1 of this module labels Jul 10, 2025
@LonMcGregor LonMcGregor added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Jul 14, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good solutions here, I have left one questions for you to answer

//Notes / Limitations:
//Time complexity is O(n²): Inefficient for large arrays.
//Mutates the input array: If you need to preserve the original, you'll need to copy it first.

Choose a reason for hiding this comment

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

Good analysis of this solution's complexity. Lots of nested loops within loops should be avoided where possible. Your other solution is clever, making use of existing javascript functionality.

const numericElements = elements.filter(element => typeof element === 'number');

// Return the sum of numeric elements
return numericElements.reduce((acc, curr) => acc + curr, 0);
}

Choose a reason for hiding this comment

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

Good use of the reduce function here

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 14, 2025
@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and review comments have been addressed and removed Reviewed Volunteer to add when completing a review labels Jul 14, 2025
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 review comments have been addressed 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants