Repository navigation
Manchester | 26-ITP-Sep | Salah Alsabhi | Sprint 1 | Coursework - #1482
Open
salahalsabhi wants to merge 9 commits into
Open
salahalsabhi wants to merge 9 commits into
salahalsabhi wants to merge 9 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Author
|
Ready for review. Completed Sprint 1:
All tests passing locally with |
cjyuan
reviewed
Nov 4, 2026
Comment on lines
+4
to
+9
| // Puzzle input | ||
| const changes = fs | ||
| .readFileSync(new URL("./input.txt", import.meta.url), "utf8") | ||
| .trim() | ||
| .split("\n") | ||
| .map(Number); |
Contributor
There was a problem hiding this comment.
Could you explain the purpose of calling trim() on the input before applying split('\n')?
Author
There was a problem hiding this comment.
Added a short comment: trim() avoids empty lines from leading/trailing newlines that would become 0 after Number().
Comment on lines
+15
to
+17
| for (let change of changes) { | ||
| frequency += change; | ||
| } |
Contributor
There was a problem hiding this comment.
Why not declare the loop variable change using const?
Author
There was a problem hiding this comment.
Changed the loop variable to const since it is never reassigned inside the loop.
cjyuan
reviewed
Nov 5, 2026
cjyuan
left a comment
Contributor
There was a problem hiding this comment.
Changes look good.
Comments professionally addressed.
Excellent work.
| const visited = new Set([0]); | ||
|
|
||
| while (true) { | ||
| for (let change of changes) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Task code
CYF-1071
Changelist
Sprint 1: fix, implement, refactor, stretch
Questions
No questions