Ad
  • Custom User Avatar

    Yes, and that's ok. In your code you did this:

    function repeatStr(s, n) {
    ...
    }
    
    repeatStr(3, "*")
    

    And had to use n as a string and s as a number to make sense of that change, because the tests called your function with the first argument being a number and the second one a string.

  • Custom User Avatar

    There is no problem, n is the number of repetitions and s is the string. In your solution you swaped them, but used s as a number and n as a string, there was no need for that.