Complete assignment 1 - #1
Open
tutoringjedi wants to merge 1 commit into
Open
Conversation
efantinatti
approved these changes
Jun 23, 2026
efantinatti
left a comment
There was a problem hiding this comment.
Assignment 1 Review - Neil Chakraborty (@tutoringjedi)
Feedback
What went well:
- Excellent paraphrase of the first‑duplicate problem.
- Two comprehensive examples with assertions.
- Efficient set‑based solution with inline tests.
- Detailed explanation of why the solution works and its complexity.
- Clearly described a nested‑loop alternative and compared complexities.
| Criterion | Passed? | Comments |
|---|---|---|
| If there are no missing cells or similar cells to the oficial repo | Passed | Submission contains unique answers |
| Problem accurately stated | Passed | |
| Two correct examples | Passed | |
| Correct and efficient code | Passed | |
| Clear explanation and complexity | Passed | |
| Clear alternative solution | Passed |
Score: 6/6
Best
@efantinatti
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.
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Populated assignment_1.ipynb with a solution to the First Duplicate in List problem, including a paraphrase, two custom examples, a coded solution, complexity analysis, and an alternative approach description
What did you learn from the changes you have made?
How a set enables O(1) average-time membership lookup, making it the ideal abstract data type for duplicate detection problems
The importance of scanning left to right and returning immediately on the first repeated value — this correctly handles the "first duplicate" constraint without any sorting or counting
The trade-off between time and space complexity: the set-based solution is O(n) time / O(n) space, while the brute-force nested loop is O(n²) time / O(1) space
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
A brute-force nested loop: for each element, scan all elements to its left and check for a match — correct but O(n²) time
A dictionary-based counter: use a dict to count occurrences and return the first key whose count reaches 2 — functionally equivalent to the set approach but uses slightly more memory since it stores counts, not just presence
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
The completed notebook wasn't being picked up by git add because the file on disk was identical to the repo version — resolved by ensuring the downloaded completed notebook was copied into the correct folder before staging
origin was pointing to UofT-DSI/algorithms_and_data_structures instead of the fork — resolved with git remote set-url origin
The repo had no main branch since it was forked with assignment-1 as default — resolved by creating and pushing a main branch locally
How were these changes tested?
All five test cases (three provided examples plus two custom ones) were run with assert statements to verify correctness
Edge cases covered: no duplicates (returns -1), multiple duplicates (returns the one whose second occurrence comes first)
A reference to a related issue in your repository (if applicable)
Checklist