Beta

Where do they meet?

Description
Loading description...
Date Time
Algorithms
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    Fixed tests and random tests have different input date string formats:

    Fixed test: 'Thu Feb 07 2019 12:00:00'
    Random test: 'Fri Oct 27 2023 11:34:44 GMT+0000 (UTC)'
    

    More crucially, why pass in date strings when passing in a Date object is infinitely more appropriate for the task? This is just bad kata design.

  • myjinxin2015 Avatar

    It's funny. When I saw the results of these testcases:

    didn't work on the following argument array: Thu Feb 14 2019 04:57:19 GMT+0000 (UTC),Thu Feb 14 2019 07:01:19 GMT+0000 (UTC) - Expected: undefined, instead got: 'between Montpellier and Nice'
    
    What? undefined?
    

    and

    didn't work on the following argument array: Thu Feb 14 2019 15:30:19 GMT+0000 (UTC),Thu Feb 14 2019 07:01:19 GMT+0000 (UTC) - Expected: 'between Saragosa and Barcelona', instead got: 'Barcelona'
    
    In my calculation, Bus2 entered Barcelona at 23:01:19, stay 1 hour, 00:01:19 run out Barcelona, Bus1 entered Barcelona at 23:30:19, so Bus1 meet Bus2 at Barcelona. Right?
    
    • wildhamster26 Avatar

      I have to create a special 'sad LOL' icon for this one... o.O

      As for the first case I don't know what happened, but when I copy pasted your times and used it on my solution I got 'between Montpellier and Nice' as well. Any idea what could have happened there? You know the system better than I do...

      As for the second case - You are totally correct. It should be exactly as you've described. I'll have to figure out my error... In the meanwhile I'll unpublish the kata.

    • wildhamster26 Avatar

      The problem was with my code. I have built a way-too-complicated solution that did not account for the minutes, instead used Date.getHours() to set new times. Not a good idea. I've changed my solution altogether, and now it should consider every single minute (but not seconds). I've also changed the difficulty to be a 6 kyu. I'm not entirely sure about it, so if I'm wrong feel free to change it.

      Thanks again for your feedback! :)

      Issue marked resolved by wildhamster26 6 years ago
    • myjinxin2015 Avatar

      It seems that it's still incorrect in the random tests:

      didn't work on the following argument array: 
      Fri Feb 15 2019 04:46:37 GMT+0000 (UTC),
      Fri Feb 15 2019 02:15:37 GMT+0000 (UTC) 
      - Expected: 'Montpellier', instead got: 'between Barcelona and Montpellier'
      
      In my calculation
      Bus1 stay at Montpellier from 16:16:37 to 17:16:37
      Bus2 stay at Montpellier from 14:45:37 to 15:45:37
      They do not meet at Montpellier.
      

      and

      didn't work on the following argument array: 
      Fri Feb 15 2019 02:18:37 GMT+0000 (UTC),
      Fri Feb 15 2019 02:15:37 GMT+0000 (UTC) 
      - Expected: 'between Montpellier and Nice', instead got: 'Montpellier'
      
      In my calculation, 14:45:37, they meet at Montpellier 
      
    • wildhamster26 Avatar

      I'm afraid this time my fault is different.

      The drive time to montpellier was 9.5 and 10.5 in the starter code but not in my solution. I forgot to update it earlier (which was another issue) but as I went over the kata again to fix the issue you've raised before I've found it and updated it as well to 9 and 11.

      That half an hour accounts for both errors.

      I am terribly sorry for this and again thank you for your feedback. I can only hope that someone who has created so many katas himself can forgive my noob problems. I'm trying to create some standard process for myslef to create a kata that'll be worth people's while with as few hiccups as possible, but I'm still learning a lot so obviously I'm missing some things here...

  • daniloxxv Avatar

    There's a syntax error (missing = ) in the JS starting code: "let meet(bus1, bus2)"