Ad
  • Custom User Avatar

    This should be at least a 7 kyu. Many other 8 kyu's are really simple oneliners. This kata requires multiple if statements and a formula you need to figure out yourself beforehand.

  • Custom User Avatar

    You don't have to split a string to calculate its length.

  • Custom User Avatar

    You can use j instead of n to add to arr[i - 1] or make j loop between arr[i - 1] and arr[i] and just push j.

  • Custom User Avatar

    This solution only loops over the array once, so it's much faster than using indexOf on every array element.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The 2 examples in the description are wrong. Those values should be in an array as one argument instead of each value as a separate argument.

  • Custom User Avatar

    Apparently, 'this' is an object instead of a string, even though my solution still passed the test in most cases. Use this.split('').join('') to get the string and work with that.

  • Custom User Avatar

    Missing test cases.
    I saw someone with a wrong solution: return num % 4 !== 1; This only gets accepted because it works with the 2 given test cases, but if the remainder is greater than 1, it gives the wrong result.

  • Custom User Avatar

    Does not always test with a string with only words that start with uppercase or only words that start with lowercase, so this line of code passes when these tests are omitted.

    return arrayUpperCase.join(' ') + ' ' + arrayLowerCase.join(' ');

    If there are only words that start with uppercase, there will be a trailing space and if there are only words that start with lowercase, there will be a space in front. These errors won't be spotted if these test cases are not generated.