Ad
  • Custom User Avatar

    C++: 500000 random tests are too many and should be redesigned with a higher probability to expect true.

  • Custom User Avatar

    C++: Failed tests should display the input.

  • Custom User Avatar

    The reference solution doesn't properly handle cases like the following, which are not possible to cover:

    n = 4
    removedSquares = {{0 ,1}, {0, 2}, {1, 0}, {1, 1}}
    
    W B W B      W _ _ B
    B W B W  ->  _ _ B W
    W B W B      W B W B
    B W B W      B W B W
    

    Changing the kata to require handling this would up the difficulty quite a bit, so it may be better to ensure these cases aren't generated in the random tests and acknowledge that they won't occur in the description.

  • Custom User Avatar

    advise:

    • python: don't use a dict of lists, use a set of coordinates and fill it with already existing coordinates. You can check if they already are in there using random_pos in your_set
    • java: same thing. And there you need the hashable coordinates.
    • both: don't copy 3 times the same code for the tests => build a function handling the whole logic and call it 3 times with the appropriate arguments
  • Custom User Avatar

    Prime number-check and happy number-check are not novel kata ideas.

  • Default User Avatar

    I must have missed something. How can the status be a negative? The lowest position a number can have is 0, and the lowest amount of element that is less than that number is also 0. Which means, the lowest status must be (0 + 0) = 0.

  • Default User Avatar

    Trying to understand how the formula works logically in the example:

    1. So basically 10,320 years ago it was 20 grams of carbon in there.
    2. After the first 5,700 years half is gone and 10 grams left.
    3. After the second 5,700 years, another half would go leaving only 5 grams.
    4. But, we only need to wait 4,620 years. So the ratio would give us 4620 x 5 / 5700 = 4.05 grams.
    5. The remaining amount should be about 5.95 grams.
      Any errors here? Or it's just less accurate than the formula?
  • Default User Avatar

    Python Translation!
    Im new to python, so if anything is wrong LMK and I will fix it

  • Custom User Avatar

    "Turn math formula into a program" is neither novel nor interesting kata idea.

  • Custom User Avatar

    it must be rounded to two decimals places

    Values should be compared for approximate equality.

  • Custom User Avatar

    Counting words and doing some integer operations is not a novel idea.

    Being an 8kyu is not an excuse for a duplicate.

  • Custom User Avatar

    Duplicate as pointed out below.

  • Default User Avatar

    I think there is a bug in the random tests. I have the following array

    ["eyid", "sfqt", "gmbo", "wfq", "gjxi", "oax", "ai", "i", "l", "joq", "m", "clxo", "xwm", "o", "p", "qj", "y", "djc", "ngu", "lygi"]
    

    which my algorithm sorts to

    ["l", "clxo", "gmbo", "xwm", "lygi", "joq", "gjxi", "wfq", "ngu", "djc", "y", "o", "m", "i", "ai", "sfqt", "eyid", "oax", "qj", "p"]
    

    The test fails with arrays first differed at element [14]; expected:<[sfqt]> but was:<[ai]> but ai is 8 and sfqt is 1851619, so ai has to be before sfqt because of rule 2 (1851619 is not a prime).

  • Custom User Avatar

    Needs random tests.

  • Custom User Avatar

    Duplicate of all if-else katas.

  • Loading more items...