Ad
  • Custom User Avatar

    All of this has been done before - see the "Linked list" series by @JDeBolt. ( One of the folds may be missing. )

    Consistency would be nice. Your function names are all over the place and your argument order is not consistent ( or standard ) either.

    Why is listMapTwoParams limited to lists of the same length?

    Why can't lists be infinite? You're missing the best feature of linked lists because you're letting yourself be restricted by a strict language. ( Actually, best feature and the only feature that makes it worthwhile doing this anyway. If we have already arrays, why would we have linked lists with worse performance? )

  • Custom User Avatar

    If you have doubts on what exactly should a function return, look at the provided example test cases. If you still have doubts, feel free to ask!

    The description should clearly explain the task with all the requirements.

  • Custom User Avatar

    The output should be a tuple.

  • Custom User Avatar

    If days part of the output should be in range [1; 31), then the timestamp must have days > 1 too.

  • Custom User Avatar
    4865-39-02-13-82-28
    y = 4865, m = 39, d = 2, h = 14
    y = 4868, m =  3, d = 2, h = 14
    
    [4868, 3, 2, 14] should equal [4868, 3, 1, 14]
    
    
    43845770626718
    
    [4388, 11, 11, 15] should equal [4388, 11, 10, 15]
    
    
    61979031284159
    
    [6204, 7, 1, 4] should equal [6204, 6, 31, 4] - 31 days in June?!
    

    Your solution is incorrect.

    if isLeapYear(y) and m >= 2 and d != 0:
        if d > 1:
            d -= 1
        else:
            m = range(12)[m-1]; d = DPM_LY[m]
    

    What the hell is this? For 0000-99-00-00-00-00 it returns [8, 3, 1, 0], for 0000-99-01-00-00-00 it returns [8, 2, 31, 0], and for 0000-99-02-00-00-0 it returns [8, 3, 1, 0] again!

  • Custom User Avatar

    Days per month should represent the real life situation

    Either your solution or the description is completely wrong:

    • Days are supposed to be converted into months assuming that the calculation is performed since the start of the year - in a string 0000_99_01_00_00_00 the 01 is the first of January, not the first of April
    • Leap years are ignored
    • Seconds are ignored
  • Custom User Avatar

    The information about HH is missing from the input specs.

  • Custom User Avatar

    Hi,

    No random tests.

    Function parameter str is the same as a built-in.