Skip to content

NW| 26-Jul-SDC | Ahmad Hmedan | Sprint 1 | Analyse and Refactor Functions - #226

Open
AhmadHmedann wants to merge 12 commits into
CodeYourFuture:mainfrom
AhmadHmedann:Sprint-1
Open

AhmadHmedann wants to merge 12 commits into
CodeYourFuture:mainfrom
AhmadHmedann:Sprint-1

Conversation

@AhmadHmedann

Copy link
Copy Markdown

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

Task code

CYF-1173

Changelist

@AhmadHmedann AhmadHmedann added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 1, 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.

The complexity analysis is spot on. The code looks good.

Could you ensure all the code is consistently formatted?

Comment thread Sprint-1/JavaScript/calculateSumAndProduct/calculateSumAndProduct.js Outdated
Comment on lines +20 to +22
if (secondSet.has(item))
//O(1) on Ave
commonSet.add(item); //O(1) On Ave

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check out this coding style article for guidance on if statements.

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 you address this comment?

Comment thread Sprint-1/JavaScript/hasPairWithSum/hasPairWithSum.js Outdated
Comment on lines +34 to +37
product:int = 1
for num in input_numbers:
total+=num
product*=num

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The spacing around the assignment operator is not consistent.

Comment on lines +16 to +21
# common_items: List[ItemType] = []
# for i in first_sequence:
# for j in second_sequence:
# if i == j and i not in common_items:
# common_items.append(i)
# return common_items

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the complexity of the original code? (The Python implementation is different from the JS implementation)

@AhmadHmedann AhmadHmedann Oct 5, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

original
Time Complexity: O(n * m * k), worst case O(n^3)
Two nested loops compare the sequences, and checking
"i not in common_items" can require scanning the result list.

new
Time Complexity : O(n+m)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why enlarged the text? It looks like 'yelling".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry about that. I didn’t realise that adding # would make the line render as a large heading. It looked small while I was typing it, so I didn’t notice.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I know you didn't meant it.

I always use the "Preview" feature to check what I typed on GitHub.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you for the feedback. From now on, I’ll use the Preview feature to check my comments before posting them.

Comment thread Sprint-1/Python/find_common_items/find_common_items.py Outdated
@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 5, 2026
@AhmadHmedann AhmadHmedann added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 5, 2026
@AhmadHmedann
AhmadHmedann requested a review from cjyuan October 5, 2026 20:28
@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 5, 2026
@AhmadHmedann AhmadHmedann added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 5, 2026
@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 Oct 5, 2026
@cjyuan

cjyuan commented Oct 5, 2026

Copy link
Copy Markdown

Why leave the "Changelist" section empty?

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants