Ad
  • Custom User Avatar

    OP solved it, closing.

  • Default User Avatar

    What I do wrong?
    Passed: 107 Failed: 6
    '4 years, 104 days, 3 hours and 4 minutes' should equal '4 years, 68 days, 3 hours and 4 minutes'
    '6 years, 246 days, 13 hours, 3 minutes and 54 seconds' should equal '6 years, 192 days, 13 hours, 3 minutes and 54 seconds'
    '8 years, 84 days, 13 hours, 41 minutes and 1 second' should equal '8 years, 12 days, 13 hours, 41 minutes and 1 second'
    '7 years, 309 days, 15 hours, 32 minutes and 54 seconds' should equal '7 years, 246 days, 15 hours, 32 minutes and 54 seconds'
    '3 years, 112 days, 1 hour, 9 minutes and 26 seconds' should equal '3 years, 85 days, 1 hour, 9 minutes and 26 seconds'
    '1 year, 28 days, 18 hours, 19 minutes and 46 seconds' should equal '1 year, 19 days, 18 hours, 19 minutes and 46 seconds'

  • Custom User Avatar

    This is due to Kotlin version is stuck at 1.3 at the time of writing this solution. However, 1.9 has been enabled now and the above warning should not happen again.

  • Custom User Avatar

    Your division and remainder logic is wrong. In the case of 62, it should be 1 minute, but for your code here

    int minutes = ((seconds % 1892160000) % 5184000) % 216000 / 3600;
    

    it yields 0 minutes...

  • Custom User Avatar
  • Custom User Avatar

    Merged

  • Default User Avatar

    This fork should fix the issue

  • Default User Avatar

    to easy for 4 kata))))

  • Default User Avatar

    oh, that's right! thanks

  • Custom User Avatar

    From spec:

    The pieces should not have trailing spaces at the end of the lines.

  • Default User Avatar

    Who can explain me the problem:
    My result in my log is:

      
    [
        '+-------------------+\n' +
        '|                   |\n' +
        '|                   |\n' +
        '|  +----------------+\n' +
        '|  |                 \n' +
        '|  |                 \n' +
        '+--+                 ',
        '                 +--+\n' +
        '                 |  |\n' +
        '                 |  |\n' +
        '+----------------+  |\n' +
        '|                   |\n' +
        '|                   |\n' +
        '+-------------------+'
    ]
      
    

    Looks like everything is ok, but:

      
    Break_pieces() failed on shape:
    
    
    +-------------------+--+
    |                   |  |
    |                   |  |
    |  +----------------+  |
    |  |                   |
    |  |                   |
    +--+-------------------+
    
    
    It returned:
    
                     +--+
                     |  |
                     |  |
    +----------------+  |
    |                   |
    |                   |
    +-------------------+
    +-------------------+
    |                   |
    |                   |
    |  +----------------+
    |  |                 
    |  |                 
    +--+                 
    
    
    But the expected value is:
    
                     +--+
                     |  |
                     |  |
    +----------------+  |
    |                   |
    |                   |
    +-------------------+
    +-------------------+
    |                   |
    |                   |
    |  +----------------+
    |  |
    |  |
    +--+
      
    
  • Default User Avatar

    Can you explain what "array size extension" is exactly? I'm looking at your answer and see "fill" and "concat". Would these not be considered array size extensions also? Is your answer the best answer? If so, is filling a new array and concat better than push and spreading? How come?

  • Custom User Avatar

    man I gotta say...super beautiful thinking. Amazing answer and amazing solution.
    I did the same calculus, but you put it so, so beautifully in code. So clean.
    All the respect man.

  • Custom User Avatar

    yes that solution is not be best because of unnecesary loops.
    but yours has unnecessary array size extension (pushs) too. same with array destructuring

  • Custom User Avatar
  • Loading more items...