Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Issue: imho, instructions should explicitly say that all the numbers in the list provided are positive (if the list provided was including negative numbers, most of the solutions would need to be different).

  • Custom User Avatar
  • Custom User Avatar

    Suggestion:

    Instructions do not explain what the function is expected to return.

    I think it is important to explain that in detail (specially considering that this is a 7 kyu kata).

    For example:

    Your function will receive 2 strings: "a" & "b".
    
    Return -1 if "a" must be sorted before "b".
    
    Return  1 if "b" must be sorted before "a".
    
    
  • Custom User Avatar

    TypeScript version fails to compile (missing export).

    Reported here: https://www.codewars.com/kata/57dd3a06eb0537b899000a64/discuss/typescript#63ac76683f04b10031696cc6

    Hope that can be solved. For some people it can be a trivial thing.
    For many others (specially considering that this is a 7kyu), it can be non trivial and prevent them from solving the real challenge.

  • Custom User Avatar

    Bug in TypeScript version:

    • Initial code in the TypeScript version fails to compile (export missing).

    IS:

    const comparator = function (a: string, b: string): number {
      // Your code here
      return 0;
    };
    
    

    SHOULD BE:

    export const comparator = function (a: string, b: string): number {
      // Your code here
      return 0;
    };
    
    
  • Custom User Avatar

    I believe instructions (or sample tests) should be much more explicit with the requirements.

    Some examples:

    isBalanced("(Sensei) says [something]", "()[]") // can a pair be closed before the second one ?
    isBalanced("(Sensei) -says- [something]", "()--[]") // can expect more than two pairs ?
    isBalanced("(Sensei says something)", "()ss") // can the pairs be any charachter? -is it safe to filter letters from the initial string? 
    
  • Custom User Avatar

    (JavaScript)

    Important improvement:

    This is a 7kyu kata and, oviously, warriors are not supposed to implement MD5 algorithm themselves.

    But, unless you've done the previous kata in the collection, it is not really obvious that you can import external modules -I've solved 40 katas on Codewars and it is the first time I see it (TBH I didn't even consider that was possible).

    Suggestion:

    Add this text at the beginning...

    Before you do this kata, it is recommended that you solve the first kata in this series: Node.js Intro

    ... and include the following tip:

    Tip:
    Remember that you can include the builtin require function to include external modules (you're not expected to implement MD5 hash algorithm yourself, there are many modules that can do that for you).

  • Custom User Avatar

    *** Fix for this bug ***

    In the Kata Test Cases, inside the function lastDayIsFridayCheck(), there's the following three lines:

      inicialDate.setYear(initialYear);
      inicialDate.setMonth(1);
      inicialDate.setDate(1);
    

    .setMonth() expects a zero-based integer (ie. 0 for January)

    The following will fix the problem:

      inicialDate.setMonth(0);
    
    
  • Custom User Avatar

    The random tests are wrong.

    For example:

    Not the correct number of Fridays between 2014 and 2014 - Expected: 2, instead got: 3

    ... but year 2014 clearly had 3 months ending in Friday.

  • Custom User Avatar

    It'd be good to add examples in the instructions (they'll look very verbose but helpful anyway).

  • Custom User Avatar

    Array.prototype.flat() is only supported from NodeJS v.11:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat#Browser_compatibility

    Codewars currently uses NodeJS v8.1.3 (you can check the version at the top of the Kata screen: there's a drop down allowing you to choose language + a dropdown to choose the version).

  • Custom User Avatar

    Instructions for this kata should actually include an additional example to explain that a word can also be an anagram of itself.

    Eg:

    There is 1 anagram in the array ["abc", "xyz", "foobar", "abc"]

    It is an important factor because implementation can be largely simplified (you can sort all the words of the array at the beginning and then just count the number of words that are equal).