Ad
  • Custom User Avatar
  • Custom User Avatar

    yup those are problems, I'm going to unpublish it in the meantime and address these flaws

  • Custom User Avatar

    There are different problems with this kata, don't know why there's one (not authors?) solution:-)? For me your example shows that i swapped rows with columns - maybe my missunderstanding or/and a problem of the description. After correction there's a new point: The sequence of the expected result, i can sort on different ways, but there's always a difference...? And sometimes i find more entries (perhaps @Unnamed's explanation, haven't looked for more details - i think it's your task to look for). The description isn't complete in some points too...

    me: 400ms Passed: 4 Failed: 5 Errors: 1
    Test Results:
     Basic Tests
     retruns a string
     returns top three in order of popularity
     works when there is only one top product
     returns an empty string when there are no sales
    Completed in 9ms
     Random Tests:
     passes with randomly generated data
    Expected: 'Savannah Smiles, Trios, Lemonades', instead got: 'Trios, Savannah Smiles, Lemonades, Caramel deLites, Girl Scout Smores, Thin Mints'
    Completed in 1ms
     passes with randomly generated data
    Expected: 'Shortbread, Girl Scout Smores, Thanks-A-Lot', instead got: 'Girl Scout Smores, Shortbread, Thanks-A-Lot, Caramel deLites, Lemonades, Peanut Butter Sandwich'
     passes with randomly generated data
    Expected: 'Peanut Butter Sandwich, Shortbread, Caramel deLites', instead got: 'Shortbread, Peanut Butter Sandwich, Caramel deLites'
     passes with randomly generated data
    Expected: 'Thanks-A-Lot, Savannah Smiles, Lemonades', instead got: 'Thanks-A-Lot, Savannah Smiles, Lemonades, Peanut Butter Patties, Peanut Butter Sandwich'
    Completed in 1ms
     passes with randomly generated data
    Expected: 'Girl Scout Smores, Peanut Butter Patties, Thin Mints', instead got: 'Thin Mints, Girl Scout Smores, Peanut Butter Patties, Lemonades, Peanut Butter Sandwich'
    Completed in 16ms
    
  • Default User Avatar

    The grid described isn't contiguous, there's a hole from 40.09 to 40.10 an so on. There's another problem though. Is the boundary the decimal 40.10 or the value represented by the literal 40.10 in JS? As the numbers are in binary, they can't be equal to these decimal fractions.

  • Custom User Avatar

    Hi, thank you for beta testing. The grid seems to be confusing everybody including me. According to my system zone 25 would return all sales in coordinates [40.20,40.29] [-90.60,-90.51]

    row 1 [40.00, 40.09] zone(1,10)
    row 2 [40.10, 40.19] zone(11,20)
    row 3 [40.20, 40.29] zone(21,30)
      
    column 1 [-91.00,-90.91] zones 1,11,21 etc..
    column 2 [-90.90,-90.81] zones 2,12,22, etc..
    column 3 [-90.80,-90.71]  
    column 4 [-90.70,-90.61]  
    column 5 [-90.60,-90.51] zones 5,15,25 etc...
    

    perhaps I could make it clearer by including a diagram?

  • Default User Avatar

    I think there shouldn't be tests with coordinates excatly on zone boundaries. It's not a strict mathematical problem and IRL the probability of it happening would be close to 0 and no one would care which zone it would be.

  • Custom User Avatar

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

  • Custom User Avatar

    thanks for the tips

  • Custom User Avatar

    only went to the 2nd decimal place

    Then it will make no ambiguity

    edit the description to use that

    Better not because not every knows what it is

  • Custom User Avatar

    Good point, that is a problem. Perhaps it would make more sense if the data I provided only went to the 2nd decimal place?
    I was not familiar with [) I'll edit the description to use that
    I considered having it so that the max and min longitude and latitude would be different every time as well as the range between them which would leave it up to the solver to determine the boundries of each grid square. I think that would make the problem more involved than it really needs to be though.

  • Custom User Avatar

    It still very strange that according to your system

    { type: 'Peanut Butter Sandwich',
      quantity: 3,
      scoutId: 87,
      saleId: 24,
      lat: 40.107,
      lon: -90.905 }
    

    belong to no area because -90.905 is not in [-91.00,-90.91] or [-90.90,-90.81]. i.e. All points in (-90.91,-90.90) are missing a relative area.
    Though i am fine with it. o_O

    Also it seems that you are not familar with this([)) notation.
    [Interval](https://en.wikipedia.org/wiki/Interval_(mathematics%29)

  • Custom User Avatar

    My sample test cases were wrong. They applied to an older version of the data which I replaced. I also changed the lat, lon description so it is hopefully more clear now.
    zone 91 would be lat 41.90,41.99 lon -91.00,-90.91, when you hit lon -90.90 you are in the second column of the grid. The Kata is live again now and If you want to give it a try!

  • Custom User Avatar

    hi, thanks for giving it a try
    I think I might have mixed up latitude and longitude somewhere in the solution or test. Zone 91 should be the 10th row from bottom and first square in the row.
    I may have a problem with my solution or test, will check tomorrow and unpublish in the meantime.
    First time posting a Kata for me

  • Custom User Avatar

    Maybe i am doing wrong?
    For zone 91, the range would be lat[40.90,41.00), lon[-91.00,-90.90)
    But i can only find Peanut Butter Patties instead of Lemonades, Trios by preloaded data.
    i.e.

    { type: 'Peanut Butter Patties',
    quantity: 5,
    scoutId: 67,
    saleId: 95,
    lat: 40.956,
    lon: -90.904 },
    
  • Custom User Avatar

    I enjoyed this Kata. I thought it was more interesting than most. I actually found it somewhat difficult for a 6. There are 4kyus that I've been able to solve more quickly than this. Anyone else think so?