6 kyu

Simple time difference

463 of 1,489KenKamau
Description
Loading description...
Algorithms
Date Time
Strings
  • Please sign in or sign up to leave a comment.
  • ahmadSaeedGoda Avatar

    Shouldn't it be stated clearly within the desc that input is guaranteed to not be empty? Having at least one time item as argument.

    I'm saying that as I'm translating the kata and wanted to ensure test cases are written properly (i.e no need to handle such an edge case e.g)

    Kindly LMK as I see the solution && test cases are based on that fact without clarifying it in the description.

    I'd rather to always have I/O section provided for any kinda kata to standardize the process a bit.

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • m_m_k Avatar

    There is probably error in test cases in cpp version in the last example.

  • ejini战神 Avatar

    Description should be language-agnostic (Removal of function names)

  • thinker.xt Avatar

    I think the verb "go off" is confusing for non-native English speakers. They could think it means "to shut down" rather than the opposite.
    So basically "goes off" means "starts ringing". If you find this helpful, give it a like.

  • pvoj Avatar

    I think the Python random tests are broken. Would you check them, please?

  • Bilithe Avatar

    for test.assert_equals(solve(["21:14", "15:34", "14:51", "06:25", "15:30"]),"09:10") how do u get 0910? Isn't the greatest time diff between alarms 0825 ( from 0625 to 1410)

  • ejini战神 Avatar

    Great kata ~~

  • Bubbler Avatar

    This comment has been hidden.

  • MyTDT-Mysoft Avatar

    ok... this is a dejavu... i think the C random tests are broken... or the description is not describing something... because it fails on random tests i ordered the alarms and clearly there is 07:28 07:28 07:50 10:00 10:00... which is a 02:09 time difference... yet the "expected" says "00:30"

  • antonkorolev02135 Avatar

    I'm confused.. solve(["23:00","04:22","18:05","06:24"]) == "11:40" The time interval between 1st and 2nd index ("04:22" and "18:05") is more than "11:40".. Then how is 11:40 calculated when it was asked to find the longest time inteval between alarms??

  • Karoluso Avatar

    INDEED !!! There is a typo in both tests in C# instead of 14:51 there is 14.51.

  • Karoluso Avatar

    INDEED !!! There is a typo in both tests in C# instead of 14:51 there is 14.51.

  • Coder2 Avatar

    C# has a typo in both the sample and full tests, 14.51 instead of 14:51.

  • clcraig Avatar

    Java has a typo in both the sample and full tests, 14.51 instead of 14:51. This will affect how it's parsed, depending on your approach.

  • bartukilickaya Avatar

    This comment has been hidden.

  • RoyalST Avatar

    Test.assertEquals(solve(["21:14", "15:34", "14:51", "06:25", "15:30"]),"09:10"); The answer is not "09:10" but "08:25"

    14:51 - 06:25 + 1 = 8:25

  • siebenschlaefer Avatar

    Translations to C and C++.

  • Insti Avatar

    Ignore duplicate times, if any.

    This seems like a redundant and potentially confusing instruction. Just ensure the test suite does not contain any duplicate times.

  • docgunthrop Avatar

    The Description is too ambiguous in explaining the task.

  • Blind4Basics Avatar

    lol, that's bullshit:

    Time: 7094ms Passed: 0 Failed: 503 Exit Code: 1
    

    not doing anything in my solution.

    SERIOUSLY? 500 random tests?

  • Blind4Basics Avatar

    hesitating between an issue and a suggestion...

    • description is incomplete about how we have to considere the data

    ...at which an alarm goes off during one day

    • what did you do so that using the dedicated tools lead me to timing out? Looks rather like a joke... x)
  • JohanWiltink Avatar

    "exmaples" ?