Ad
  • Default User Avatar
  • Custom User Avatar

    Please use spoiler flag next time.

  • Custom User Avatar

    looks like code written by someone who doesn't want to get hired or work in a team :)

  • Default User Avatar

    Thank for the info, I didn't know that.

  • Custom User Avatar

    It's a limit on recursion, not a kata bug.

  • Default User Avatar

    const isLeapYear = y => y % 16 ==0
    this is also my solution but it fails lets say for the year 4 or 8 !!!
    Yes it need to have test cases for this years too!

  • Default User Avatar
  • Default User Avatar

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

  • Custom User Avatar

    @donaldsebleung

    I took another look at this one today and was able to pass it in less than a second.

    I believe the trick is that it's very slow to just keep concatenating strings over and over (since you're basically remaking the whole string every single time you do it), so you're going to want to look into some different, faster way to concatenate your strings.

  • Custom User Avatar

    @Souzooka I'm having the exact same problem right now; I deliberately commented out my loops to view the console output and that indeed appears to be the case - some of the numbers used were well above 5000, let alone 500 :(

    @GrahamD I suggest that you either edit the C# translation to make the tests a bit more lenient or explicitly state in the Description that there will be performance testing in the C# version - after all, this Kata appears to be aimed at beginners so the average solver would not expect the tests to be so harsh.


    @Souzooka, BTW is there any chance that you might have completed this Kata in C# since writing this comment and if so, may you please drop me a hint? ;)

  • Default User Avatar

    If a pair of input like this (1,3), should print
    *
    *
    *
    a lot of the solutions won't print it, including mine, instead, will print
    *
    **
    *
    hence the solution it might not be taking care of all the possible cases
    Have I misunderstood the problem and what I am trying to point out here is futile or it should be in the random tests, inputs like
    (1,h>2)?

    Thanks

  • Default User Avatar

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

  • Custom User Avatar

    I concur, you can brute-force it (although I don't know if there would be a more efficient way to just skip numbers, except just checking if they were even or something, but that's all I can really think of) by checking every number, as long as you know how to check if a number is prime efficiently.

    Not really a hard Kata.

  • Custom User Avatar

    Is it? I don't think it's that hard as a 6kyu. You just need to think of how many number to test a bit carefully.

    Katas like this would be the ones that truly should be up-ranked to 6kyu.

  • Custom User Avatar

    Did you mutate the input array in place instead of returning a new, wave-sorted array?

    That's the requirement if you look at the test cases.

  • Loading more items...