From b57a4d14f91d6ee7e08e4e2e23fe43bcaaf83dd5 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 13 Jun 2022 10:27:25 +0200 Subject: [PATCH] Fix(curriculum): external Tower of Hanoi link in CIP (#46434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * removed the link * changed description * made example into one sentence and the description into another * Grammar typos Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> * Yeab clearer and better description 👌 Co-authored-by: Jeremy L Thompson * Fix has been made 🛠️ Co-authored-by: Niraj Nandish Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Co-authored-by: Jeremy L Thompson Co-authored-by: Niraj Nandish --- .../rosetta-code/towers-of-hanoi.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/towers-of-hanoi.md b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/towers-of-hanoi.md index 4de9c851ba4..9ccf94e0064 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/towers-of-hanoi.md +++ b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/towers-of-hanoi.md @@ -8,13 +8,13 @@ dashedName: towers-of-hanoi # --description-- -Solve the [Towers of Hanoi](https://en.wikipedia.org/wiki/Towers_of_Hanoi "wp: Towers_of_Hanoi") problem. +Solve the Towers of Hanoi problem. The number of objects will be given as the first parameter, followed by the strings used to identify each stack of objects. Create a nested array containing the list of moves, `["source", "destination"]`. + +For example, the parameters `(4, 'A', 'B', 'C')`, will result in nested array of moves `[['A', 'C'], ['B', 'A']]`, indicating that the 1st move was to move an object from stack `A` to `C` and the 2nd move was to move an object from stack `B` to `A`. -Your solution should accept the number of discs as the first parameters, and three string used to identify each of the three stacks of discs, for example `towerOfHanoi(4, 'A', 'B', 'C')`. The function should return an array of arrays containing the list of moves, source -> destination. +# --instructions-- -For example, the array `[['A', 'C'], ['B', 'A']]` indicates that the 1st move was to move a disc from stack A to C, and the 2nd move was to move a disc from stack B to A. - -

+Write a function that returns the moves to stack the objects in a nested array. # --hints--