Skip to content

recursion exercises: refactor: simplify recursion logic in exercises 4 and 5 for learner clarity - #671

Merged
mao-sz merged 3 commits into
TheOdinProject:mainfrom
damon314159:refactor-simplify-recursion-logic
Sep 8, 2026
Merged

recursion exercises: refactor: simplify recursion logic in exercises 4 and 5 for learner clarity#671
mao-sz merged 3 commits into
TheOdinProject:mainfrom
damon314159:refactor-simplify-recursion-logic

Conversation

@damon314159

Copy link
Copy Markdown
Member

Because

I believe the example solutions provided could do a better job at clearly demonstrating to learners the recursive steps, without additional syntax noise and overly complex logic. See the issue linked below for more detail.

Please note this is not me submitting my solutions as a learner, I am aware of and understand that rule.

This PR

Refactors the example solutions to both those exercises in the way described in my linked issue
All tests still pass

Issue

Closes #670

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. 01_helloWorld: Update test cases
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If this PR includes any changes that affect the solution of an exercise, I've also updated the solution in the /solutions folder

@mao-sz mao-sz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @damon314159 and for the detailed write-up. I agree on both fronts.

Comment thread computer_science/recursion/5_pascal/solution/pascal-solution.js Outdated
Comment thread computer_science/recursion/5_pascal/solution/pascal-solution.js
Comment thread computer_science/recursion/5_pascal/solution/pascal-solution.js
Comment thread computer_science/recursion/4_permutations/solution/permutations-solution.js Outdated
Comment thread computer_science/recursion/4_permutations/solution/permutations-solution.js Outdated
@damon314159
damon314159 requested a review from mao-sz September 8, 2026 16:32

@mao-sz mao-sz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@mao-sz
mao-sz merged commit 58cb8c8 into TheOdinProject:main Sep 8, 2026
2 checks passed
@damon314159
damon314159 deleted the refactor-simplify-recursion-logic branch September 8, 2026 21:29
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.

recursion exercises: simplify example solution logic

2 participants