Skip to content

Update assignment_1.ipynb - #121

Closed
AilNoir wants to merge 1 commit into
UofT-DSI:mainfrom
AilNoir:assignment-1
Closed

AilNoir wants to merge 1 commit into
UofT-DSI:mainfrom
AilNoir:assignment-1

Conversation

@AilNoir

@AilNoir AilNoir commented Oct 25, 2026

Copy link
Copy Markdown

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

Implemented solutions for the balance bracket check and moving zeros to the end of a list.

What did you learn from the changes you have made?

  1. Mastered using a Stack (Python list) for linear parsing and handling bracket order.
  2. Learned how to use an in-place two-pointer technique to optimize array modification.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Considered string manipulation/replacement for brackets and using an auxiliary temporary array for moving zeros.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

Challenge: Handling loose closing brackets when the stack is empty.
Fix: Handled boundary conditions securely using inline validation (if not stack / if stack else '#').

How were these changes tested?

Validated against all 4 original problem examples and created custom edge cases to verify output alignment.

A reference to a related issue in your repository (if applicable)

Checklist

  • I can confirm that my changes are working as intended

@github-actions

Copy link
Copy Markdown

This pull request was made to the wrong repository. If you are a participant, please close it and open it in your own fork instead. Refer to the Assignment Submission Guide for detailed instructions.

@github-actions github-actions Bot closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant