Ad
  • Custom User Avatar
  • Custom User Avatar

    I agree, "overlapping" was an ufortunate word, I changed the description.

    The idea is to find the maximum number of visits which were simultaneously in progress.

    A singular visit without any others counts as 1 -- as in reply above.

  • Custom User Avatar

    Maybe the description of visits_count should be changed to maximum count of simultaneous visits

    In this situation, visits_count should be 1, and when_happened should be the earliest event.

  • Custom User Avatar

    This kata is very poorly described.
    At least provide some examples on particular cases like the one in the test.
    Where is the overlapping event here?

    id entry_time exit_time
    1 2019-04-01 00:00:00 +0000 2019-04-03 00:00:00 +0000
    2 2019-04-08 00:00:00 +0000 2019-04-09 00:00:00 +0000

    What should I do when there are no overlapping events?

  • Custom User Avatar

    fixed - updated the description

  • Custom User Avatar

    Email script differ between description and tests:

    "(...)Unfortunately, you have selected a bad(...)" (description)

    vs.

    "(...)Unfortunately you have selected a bad(...)" (test).

  • Custom User Avatar

    It probably should, but I believe that was not the point of your original remark.

  • Custom User Avatar

    Perhaps this issue would benefit from being re-written with appropriate cases. It's a waste of time to work with inconsistent input, as the saying goes - "garbage in, garbage out." In reality, people work with actual data rather than just descriptions of it. When something goes wrong, it's necessary to provide the dataset that caused the issue. I find it amusing that many computer science challenges focus on "corner" cases. In my experience working on production problems, developers don't typically think about "corner" cases; they focus on addressing the specific problem at hand. While there may always be another "corner" case that arises, the sheer number of potential cases is unlimited, so the idea of covering them all is unrealistic.

  • Custom User Avatar

    Maybe the default test should include result validation? :-)

  • Custom User Avatar

    I'm not aware of any errors. Correct solution passes tests just fine.

    Which test did fail for you with that 'expected result'?

    The default test - the only with the above dataset - doesn't include result validation.

  • Custom User Avatar

    Is something wrong with the simple test?

    select * from visits;
    
    id	entry_time	exit_time
    1	2019-04-01 00:00:00 +0000	2019-04-03 00:00:00 +0000
    2	2019-04-08 00:00:00 +0000	2019-04-09 00:00:00 +0000
    

    The above obviously do not overlap, but the expected result is

    when_happened	visits_count
    2019-04-01 00:00:00 +0000	2
    
  • Custom User Avatar

    Very challenging kata, very good thing to learn how to count overlaps. Had to draw a lot of diagrams just visualise what my query is attempting to do.

  • Custom User Avatar

    Sets the name (alias) of result column.

  • Custom User Avatar

    What does "as mod" do?

  • Custom User Avatar

    You're right on all counts! Thanks!

  • Loading more items...