mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): add missing infos in permutations lab user stories (#66034)
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ This continues until the prefix has all the letters, and the rest of the string
|
||||
**User Stories:**
|
||||
|
||||
1. You should create a function named `permuteString`.
|
||||
2. The `permuteString` function should take three parameters: a string, a prefix value and an empty array for storing and returning the results. The prefix value should be a string used to accumulate characters to form a permutation.
|
||||
2. The `permuteString` function should take one parameter, a string, and then two parameters with a default value: a prefix value and an empty array for storing and returning the results. The prefix value should be a string used to accumulate characters to form a permutation. The function will be called with one single argument, like `permuteString("cat")`.
|
||||
3. Inside the function, you should check if the length of the passed string is `0`. If it is, push the current prefix to the results and return the results.
|
||||
4. Iterate over each character in the input string and for each iteration, remove the current character from the string and call the `permuteString` function recursively with updated arguments to build the remaining permutations.
|
||||
5. You should return the final results array.
|
||||
|
||||
Reference in New Issue
Block a user