6 kyu

The latest clock

1,450 of 2,904nirgn
Description
Loading description...
Date Time
Fundamentals
Algorithms
  • Please sign in or sign up to leave a comment.
  • Timuruch Avatar

    Bruh, The C Translation is imposible, because of the string that waits for 7 chars. (In feedback only 5 chars (12:45), Making C Vatiant imposible, i mean for me...)

  • tomask272 Avatar

    This Kata should be more then 6. At least 5. It was fun and challenging before I passed all the tests.

  • UnluckyDjentleman Avatar

    To be honest, this task deserves more than 6 kata. Excellent work!

  • Heathro Avatar

    that was very interesting, thanks!

  • MarkShcerbakov Avatar

    Very good and funny Kata! Thanks to author!!!

  • rowcased Avatar

    C Translation (author inactive).

  • pedron13 Avatar

    Help me! My code passes, but I still this messages. In my conde, I don´t try to import latest_clock from solution

    Traceback (most recent call last): File "/workspace/default/tests.py", line 5, in from solution import latest_clock ImportError: cannot import name 'latest_clock' from 'solution' (/workspace/default/solution.py)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/workspace/default/tests.py", line 7, in from solution import late_clock as latest_clock ImportError: cannot import name 'late_clock' from 'solution' (/workspace/default/solution.py)

  • Jakisley Avatar

    my brain is broken now thx :)

  • jebreen Avatar

    C# version kumited

  • jebreen Avatar

    Ruby version kumited

  • jebreen Avatar

    10 minutes in Python, with 2 iterations

    nice

  • Xros22 Avatar

    crazy. 30 lines of code later, and my brain is numb.

  • Alexalalex  Avatar

    Help me please. The code passes checks and the last message:

    Traceback (most recent call last): File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper func() File "/workspace/default/tests.py", line 62, in random_tests test_it(result) File "/workspace/default/tests.py", line 41, in test_it test.assert_equals(latest_clock(*ds), expected, msg) ^^^^^^^^^^^^^^^^^ File "/workspace/default/solution.py", line 82, in latest_clock time.remove(max(last_time)) ValueError: list.remove(x): x not in list

  • miggycoder Avatar

    This 6 kyu does require quite the brian power, took me roughly 1 1/2 hours.

  • vailcolorado13 Avatar

    This one was a doozy - had me working on it all afternoon before I came up with something that worked

  • KingOfDice Avatar

    I wrote a program that gives the latest time, but in the tests the correct answer is NOT THE LATE TIME. Can i fix that? Some exemples: latest_clock(1, 1, 9, 0) should return "19:10": '19:19' should equal '19:10' latest_clock(1, 3, 1, 3) should return "13:31": '13:33' should equal '13:31' latest_clock(1, 7, 3, 1) should return "17:31": '17:37' should equal '17:31' latest_clock(9, 0, 2, 3) should return "23:09": '23:39' should equal '23:09' latest_clock(1, 5, 7, 1) should return "17:51": '17:57' should equal '17:51' latest_clock(6, 1, 0, 5) should return "16:50": '16:56' should equal '16:50'

  • taurscratch Avatar

    Are 4 digits supposed to be the ones from test cases only or all possible digits? If so 'Every inputs have valid answer' might not agree with the input 5,6,7,8 .

  • Alucard2169 Avatar

    In the example section, we have

    digits: 9, 1, 2, 5 => result: "21:59"

    why can't it be digits: 9, 1, 2, 5 => result: "19:25"?

  • Cloud Walker Avatar

    This kata... she's a beauty. My approach/strategy was good and perfectly executed. Sometimes you get off on the wrong foot and your code ends up a lot longer than it needs to be. This wasn't one of those times. Went through it like a hot knife through butter. Very enjoyable kata.

  • SashkaPashka Avatar

    My brain is getting pain.....

  • les-friesen Avatar

    This was deceptively more complex than I thought it would be, based on the simple instructions. Fun kata :)

  • KayleighWasTaken Avatar
  • Rhino010 Avatar

    Traceback (most recent call last): File "/workspace/default/tests.py", line 1, in from solution import latest_clock ImportError: cannot import name 'latest_clock' from 'solution' (/workspace/default/solution.py

    Has anyone else received this error when attempting this kata? My code passes all the tests and seems fine but when I attempt it, there is the issue of attempting to import 'latest_clock' that I don't see.

  • KayleighWasTaken Avatar
  • AliAliyev17 Avatar

    late_clock(9, 1, 2, 5) should return "21:59" '19:25' should equal '21:59'

    19:25 is still a valid answer, but for some reason only 21:59 is taken as true. Would be great if other valid answers could also be detected, or the criterion be disclosed in the description. Fun kata nonetheless!

  • KayleighWasTaken Avatar

    Scala translation

    Identical testing scheme to python.

  • natan Avatar

    Haskell translation

    • nearly identical (quickcheck may change it slightly) tests to python
    • reworded the last sentence in the description
  • Unnamed Avatar

    Edge case tests like [1, 2, 8, 9] would be nice to have.

  • Joz Avatar

    No random tests given =(

    Also it would be great to have at least one in example test cases.