Ad
  • Custom User Avatar

    seems to me like the dart version codewars has installed is 32bit and thus has ints of size 32 where your numbers don't fit. that's not a kata issue.

  • Custom User Avatar

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

  • Custom User Avatar

    For some reasons, with the simple function to find the factorial in Dart language. It does not work right

    Total: 1
    Next: 1
    Total: 1
    Next: 2
    Total: 2
    Next: 3
    Total: 6
    Next: 4
    Total: 24
    Next: 5
    Total: 120
    Next: 6
    Total: 720
    Next: 7
    Total: 5040
    Next: 8
    Total: 40320
    Next: 9
    Total: 362880
    Next: 10
    Total: 3628800
    Next: 11
    Total: 39916800
    Next: 12
    Total: 479001600
    Next: 13
    Total: 6227020800
    Next: 14
    Total: 87178291200
    Next: 15
    Total: 1307674368000
    Next: 16
    Total: 20922789888000
    Next: 17
    Total: 355687428096000
    Next: 18
    Total: 6402373705728000
    Next: 19
    Total: 121645100408832000
    Next: 20
    Total: 2432902008176640000
    Next: 21
    Total: -4249290049419214848
    Next: 22
    Total: -1250660718674968576
    Next: 23
    Total: 8128291617894825984
    Next: 24
    Total: -7835185981329244160
    Next: 25

    In the step
    Total: 2432902008176640000
    Next: 21
    Total: -4249290049419214848
    It should be take the total and multiple to 21 = 5.1090942e+19 but the result was negative number
    I have tried in Dartpad and the result is correct

  • Custom User Avatar

    new RegExp(s) is the syntax used to create a new regular expression (often abbreviated with regex) in dart.
    In order to do so, it internally parses the String s, verifying that it is a valid regex in the process.

    Now we must know that parentheses are part of the syntax for regexes (specifically, they are used to define so called capture groups) and they need to be nested exaclty like this kata is asking in order to be a valid in it.

    In this code, the author is testing if new Regexp(parentheses) executes correctly (if so, the input is valid) or throws an exception (input is invalid).

    The fact that this works is a coincidence and this may not be great for production code. Nonetheless it is a concise solution that just works and certainly a great way to remind us the power of the too often neglected regular expressions 😆

  • Custom User Avatar

    Can anyone explain what the hell is going here ?????? PLEASE !!!

  • Custom User Avatar

    I cannot say what is actualy wrong in the code but i know which test fails:
    console.log("Result from my solution is "+iqTest("1 1 2")); --> should be 3 but is 2
    console.log("Result from my solution is "+iqTest("1 2 2")); --> should be 1 and is 1
    console.log("Result from my solution is "+iqTest("1 2 1")); --> should be 2 but is 1

    I think your code just checks for a change but does not take into account the next step

  • Custom User Avatar

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

  • Custom User Avatar

    Your code cant check if the number is 5xx, x5x,...These numbers include 5 digit too

  • Custom User Avatar

    Not a kata suggestion, don't post solutions in Discourse.

  • Custom User Avatar

    OMG ! I laugh like crazy

  • Custom User Avatar

    OMG ! I laugh like crazy

  • Custom User Avatar

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