-
Notifications
You must be signed in to change notification settings - Fork 34.6k
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
feat(hanoi): create exercise #448
Open
NikitaRevenco
wants to merge
21
commits into
TheOdinProject:main
Choose a base branch
from
NikitaRevenco:feat/exercise_20
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(hanoi): create exercise #448
NikitaRevenco
wants to merge
21
commits into
TheOdinProject:main
from
NikitaRevenco:feat/exercise_20
Conversation
This file contains 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
NikitaRevenco
changed the title
New exercise | Tower of Hanoi
(20) New exercise | Tower of Hanoi
Mar 24, 2024
3 tasks
Ready for review! |
MaoShizhong
suggested changes
Jul 3, 2024
Co-authored-by: MaoShizhong <[email protected]>
Co-authored-by: MaoShizhong <[email protected]>
Co-authored-by: MaoShizhong <[email protected]>
Co-authored-by: MaoShizhong <[email protected]>
NikitaRevenco
changed the title
(20) New exercise | Tower of Hanoi
feat(hanoi): create exercise
Aug 9, 2024
MaoShizhong
suggested changes
Aug 18, 2024
Co-authored-by: MaoShizhong <[email protected]>
Co-authored-by: MaoShizhong <[email protected]>
Co-authored-by: MaoShizhong <[email protected]>
Co-authored-by: MaoShizhong <[email protected]>
MaoShizhong
added
the
Status: Do Not Merge
This PR should not be merged until further notice
label
Aug 20, 2024
MaoShizhong
suggested changes
Aug 25, 2024
20_hanoi/README.md
Outdated
Comment on lines
21
to
38
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 <[email protected]>
MaoShizhong
reviewed
Aug 25, 2024
…be in Co-authored-by: MaoShizhong <[email protected]>
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.
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 change
format, e.g.01_helloWorld: Update test cases
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section/solutions
folder