Ad
  • Custom User Avatar

    should include some examples where equation starts with a negative number. e.g. -2*3 etc.

  • Custom User Avatar

    Note: since n can be a very large number, it will be represented as a binary string.

    Use appropriate datatypes. Python has arbitrary precision ints, so this non-standard encoding is unnecessary.

  • 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

    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

    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

    Why 1-based indices in Python?

  • Custom User Avatar

    The input range is missing. How big can max_x, max_y and num_reflections be? How big is the coordinates of point, and can they be 0 or negative?

  • Default User Avatar

    Hey!! I'm a bit overwhelmed by this interesting Kata. I have come up with a solution but it is some seconds slower than expected. Any help for someone like me with no idea of algorithms??

    Thanksss!!

  • Custom User Avatar

    Ruby 3.0 should be enabled, read this to learn how to do it

    Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)

    describe "<This message should describe the categories of test groups inside this block>" do
      it "<A short message describing this test group>" do
        expect(...).to eq(...) #Assertions
        #Or Test.assert_equals(user_response, reference_response)
      end
    end
    
  • Loading more items...