Ad
  • Custom User Avatar
    • Description should be language-agnostic.

    • The note part can be simplified to the 2nd argument will always be greater than or equal to the 1st one.

  • Custom User Avatar
  • Custom User Avatar

    Since this Kata has performance requirements, it should be tagged as such.

  • Custom User Avatar

    Missing solution and framework import in Python's tests and sample tests

  • Default User Avatar

    Python random testing allows for an insufficient solution to intermittantly pass. High enough values, such as n = 525194 should be guaranteed to be passed to the user.

  • Default User Avatar

    Guys, I need help. I quickly pass all the tests, but when I get to the performance test I get the maximum recursion depth. I've been trying to decide for several days now, I've run out of ideas.

  • Default User Avatar

    Does anyone have any hints for handling the performance tests? I've backed myself into a corner and a hint would go a long way :)

  • Default User Avatar

    350417903 866449540
    [11, 27601766442010420] should equal None

    I have received that in the test attempts, with several different cases. I believe that in those cases the"None" is wrong

  • Custom User Avatar

    Hi,

    Good one, but hard (like most of the time with you). I've got the longest solution so far, but the fastest as well, so... at least I didn't lose my time.

    • There is... this in the sample tests: print(disputes([['#']])), which is useless and invalid (and makes solutions fail)

    • Missing sample and fixed tests:

    [('''\
    ##.....#
    #.....##
    ..###.##
    .####...
    ##..####
    #.#.##.#
    #.#.####
    ...##...
    ....####
    #...##.#'''.split('\n'), (33,1)),
    
    ('''\
    ##.#.##.#.#
    ........#..
    #...###.###
    .#..#.#..##'''.split('\n'), (28,8)),
    ]
    
    • More sample tests could be a good idea as well, but I think with the 2 above that could be enough. Note that you could increase easily the number of sample tests by rotating the grids (actually useful for my approach only, but...)

    • The stress tests have to be put after the batch of small random tests (at least) => the test suite could be split differently so that the perf checks are all done last. Something like:

      • describe: warm up
        • it: fixed tests
        • it: small random tests
        • it: medium random tests
      • describe: performance tests
        • it: stress tests
        • it: random tests
    • The batch of small random tests has to be extnded to at least 50 tests. It costs no time at all, and allow to properly debug the solution (I actually discovered the edge cases above by chance, running a fork. My code was passing all other tests otherwise)

    • The specs of each batch have to be at least hinted in the description:

      • typical number of tests
      • typical grid dimensions
      • typical number of countries (possibly)
      • typical amount of unclaimed territory (possibly)

    Cheers!


    Edit: oh, and this fixed test must be added as well. Very important...

    #...#..##.#...
    .###.#.#.###.#
    ..#.#........#
    #.#....#......
    .###......#.##
    .###...##.##.#
    ######.#####.#
    ..#.##.#####..
    .###..######..
    #.#.##########
    .###..######..
    ..#.##.#####..
    exp = (62, 23)
    
  • Custom User Avatar
    • not enough small random tests (but WHY 3 only!???):

      Fixed Tests
      Example Test Cases
      (2 of 2 Assertions)
      
      Stress Test Cases
      (2 of 2 Assertions)
      Completed in 1805.90ms
      
      Random Tests
      
      Small Random Test Cases
      (3 of 3 Assertions)
      
      Medium Random Test Cases
      (396, 82) should equal (391, 89)
      (125, 56) should equal (125, 59)
      (237, 61) should equal (233, 68)
      (174, 35) should equal (173, 36)
      
    • the acutal profile of the random tests aren't given (how many tests of this or that kind / typical sizes, but typical number of groups as well)

    • the stress test should be described as well

  • Custom User Avatar

    Missing an edge case where every land is unclaimed (the map is full of #). The expected result should clearly be (0, 0), but all existing solutions (except mine) fail at this case.

    (This is not ruled out by the description, and logically has no reasons to be excluded. Some lands could just be that pure ;-))

  • Custom User Avatar

    Perhaps include a larger non-symmetrical sample test?

  • Default User Avatar

    C Translation kumited. This includes both the Kacarott extra sample test and updated description.

  • Custom User Avatar

    I'm actually surprized the solution is that simple... Does anyone have a proof that this is really optimal?

  • Default User Avatar

    Why 1-based indices in Python?

  • Loading more items...