-
Notifications
You must be signed in to change notification settings - Fork 43.4k
feat(hanoi): create exercise #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Ready for review! |
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
20_hanoi/README.md
Outdated
| Your task is to create a function, `hanoi(n)`, that when given the number of disks in the starting tower (`n`), will return an array. The first element of this array will be the towers' initial state. The last element will be the towers' final state. Every intermediary element will represent a step to get from the initial position to the final position. | ||
|
|
||
| The function **must** return a solution in the minimum number of moves. i.e. there will be no duplicates in the array returned. | ||
|
|
||
| For example, `hanoi(3)` will output the Tower of Hanoi solution as a series of steps: | ||
|
|
||
| ``` | ||
| [ | ||
| [[3, 2, 1], [], []], | ||
| [[3, 2], [], [1]], | ||
| [[3], [2], [1]], | ||
| [[3], [2, 1], []], | ||
| [[], [2, 1], [3]], | ||
| [[1], [2], [3]], | ||
| [[1], [], [3, 2]], | ||
| [[], [], [3, 2, 1]], | ||
| ] | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instructions need to be amended to reflect the new requirements of returning an array of strings with the moves - the required string template must be provided as well.
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
…be in Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
|
I've got the other PRs mostly ready to go for the Ruby course, so hopefully we can finally get this work merged soon. The main thing giving me pause right now is this specific exercise, which I'm not entirely sold on for a couple of reasons:
Willing to be swayed on some of this though if either of you are really set on keeping it around @mao-sz @nik-rev |
|
@JoshDevHub I don't have a particularly strong opinion on this; your points make a lot of sense. I'm more than happy to defer to your judgement on this 👍 |
|
Since we've all come to a consensus, let's get rid of this one! |
Because
I think this exercise should be the last one because in my mind it's the most difficult one.
This PR
Issue
Related to #27265
Additional Information
Pull Request Requirements
location of change: brief description of changeformat, e.g.01_helloWorld: Update test casesBecausesection summarizes the reason for this PRThis PRsection has a bullet point list describing the changes in this PRIssuesection/solutionsfolder