Ad
  • Default User Avatar

    C++ sample test is broken. Throws errors.

  • Default User Avatar

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

  • Default User Avatar

    C++ solution isnt working. Keeps throwing errors. Cannot solve this. Terrible question description as well. Downvoting.

  • Default User Avatar

    The name of this kata should be changed. While vectors represent arrays, we're not working with sorted arrays. Nor are we even working with sorted vectors. The question contains arbitrary size vectors with arbitrary number distribution. This should be clarified via the title and description. It also helps users create a focused solution since they dont have to interpret the definition of the kata.

  • Default User Avatar

    There's a small hint in the kata about how you determine the count. Read carefully and understand. I didnt understand why my code wasnt correct and i reread and the light bulb turned on.

  • Default User Avatar

    This shouldnt be worth 6 kyu. An algorithmic approach is extreme overkill. Work smarter, not harder. Once you do some basic math you quickly spot the pattern and realize... there is a library for this! and literally write 1 line of code.

  • Default User Avatar

    I understand 48 guys passed. This isnt related to the attempt, but the skeleton sample test which is clearly incorrect and doesnt affect the final attempt. Based on your defined logic, looking at the numbers in the array i posted above (which is from the sample test), you clearly have 2 pairs of consecutive k-primes, not 1. I can easily change the sample test result to 2 and pass it.

  • Default User Avatar

    I think there is an error in the example test solution (java): testing(5, new long[] {10188, 10192, 10212, 10184, 10200, 10208}, 1); This has 2 consecutive k-primes (10212,10184),(10200,10208).

  • Default User Avatar

    No. Instructions say "Same" means that the elements in b are the same elements in a, squared. Thus, you could say if b = [ 16, 16, 16, 16, 16, 16, 16] and a = [4], this qualifies as "same" since the elements in b are the same as in a, but squared. There is no 1:1 ratio happening and if there is, its extremely poorly worded. Even looking at the first example of valid arrays you see multiples of squares, thus 1:1 cannot be true. And if it was, my solution would fail.

  • Default User Avatar

    The question doesnt ask for 1:1 though. I am coding mine without doing 1:1 and it works fine (except for an issue with null/empty which i cant figure out).

  • Default User Avatar

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

  • Default User Avatar

    I got the solution, but using content. I dont quite understand how to determine the days without content unless i misunderstand the parameters of the question. If evap_per_day is a percentage of your content lost per day and threshold is the minimum percentage of content until you consider it gone, i dont see how to calculate this without knowing how much content you have to start with. Going by the first test where its 10,10,10,22, if you change the content from 10 to 20, that changes the answer. But if you only use evap_per_day and threshold, that would change which doesnt make sense. Can someoneone elaborate on this? Thanks

  • Default User Avatar

    Althought it might not be a big issue, it is really annoying to deal with the different spacings in the solution for negatives/zeros and random numbers.
    Expected: equal to 0=0
    Actual: 0 = 0

    My solution is fine, but because of spacing i need to adjust it. Also, its inconsistent with the first test which does provide spacing "0+1+2+3+4+5+6 = 21".