Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README file
  • Loading branch information
ibr5500 committed Mar 8, 2023
commit 20c5949ffe2e8409eb9f65f81792ccdf1b8897ad
16 changes: 11 additions & 5 deletions L-I/0006 Repeat a String (L-I)/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ repeat a given string `str` for `num` of times, and return empty in case the nu

#### Note: you are not allowd to use `.repeat()` method.

## Test case:
## For testing:

- Input: 'abc', 3 => Output: 'abcabcabc'
- Input: 'abc', 0 => Output: ''
- Input: 'abc', -2 => Output: ''
- run
```
npm i
```
to install mocha library, then run
```
npm test
```

## Solution:

Expand All @@ -24,4 +29,5 @@ const repeatStringNumTimes = (str, num) => {
};
```

>- [click](https://www.khanacademy.org/computing/computer-science/algorithms/recursive-algorithms/a/recursion) To lern more about recursion method
[click](https://www.khanacademy.org/computing/computer-science/algorithms/recursive-algorithms/a/recursion) To lern more about recursion method