Ad
  • Custom User Avatar

    come on, that's better than many top voted ones

  • Custom User Avatar

    looks like code written by someone who doesn't want to get hired or work in a team :)

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Revising this kata is not going to work - retirement is final. If and when you publish another first kata, please have some original idea for it ( which is hard! with thousands of kata already published ).

  • Custom User Avatar

    The idea may be inspired, but as a kata on CodeWars, it's not, really. Think of it not as "what can CodeWars do for me" but as "what can I do for CodeWars". CodeWars already has a number of kata that are quite like this one, so it's not adding value to CodeWars.

    When you publish a kata, you will be held to the standard of a kata creator, not any beginner, and that standard is high. CodeWars has thousands of kata already, and publishing a duplicate just because you would like to publish a kata ( any kata ) is rightly frowned upon. That is documented. Did you read that documentation? ( It also includes "have random tests". )

  • Custom User Avatar

    from a definiton of other functions you have a point, from the purpose of the function, to return the number of seconds a video is playing, -1 suggests somebody has a time machine and can go back.

    That's precisely the point. -1 is a valid member of the codomain in terms of type ( any negative signed intger is ), but in terms of the value it represents in the real world, it's impossible. 0 is a valid value in the type and in the real world, and does not always signal invalid input. You want to make that distinction.

    I'm trying to figure how can I improve on "Sample tests should contain examples of invalid input."

    Add a test with invalid input, and expect the appropriate output? Don't overthink it.

  • Custom User Avatar

    I'm trying to figure how can I improve on "Sample tests should contain examples of invalid input."

  • Custom User Avatar

    from a definiton of other functions you have a point, from the purpose of the function, to return the number of seconds a video is playing, -1 suggests somebody has a time machine and can go back.

  • Custom User Avatar

    The idea is completely uninspired. Feeling like trolling or did you forgot how it is to be a beginner?
    The idea is completely inspired as it comes from real requirement from real project that I or my students encounter at work.

    I'll revise regarding input validation. Thanks for your time!

  • Custom User Avatar

    Good pointers! I'll revise.

  • Custom User Avatar

    a function that accepts a string

    Then why do we have to accept undefined, {} and a Number ?

    This is not completely separate from "don't do input validation" below, but also a gripe in itself. A description should be correct, complete and consistent, and get your datatypes straight!

  • Custom User Avatar
    • Input validation is a worthless requirement
    • The idea is completely uninspired - splitting a string and doing math are trivial, entry-level things used among hundreds of katas, and asking to do the same over and over again is a waste of everyone's time
  • Custom User Avatar

    No random tests

    Sample tests should contain examples of invalid input.

    Also, 0 shouldn't be the return value for invalid input. -1 or throwing an error would be better.

  • Loading more items...