Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Profile pic

    Python, Groovy, Java and Scala translations kumited. Please, review and approve. Thanks, suic

  • 1733057?v=3

    ok, hard to learn for others this way ;)

  • 7867810?v=4

    Hmmm, i coded exactly in the way it presents, just... a habit o_O
    // Next time when you post with spoiler mark, please post another non-spoiler to manually notify in case you wish to be replied

  • 1733057?v=3

    This comment is hidden because it contains spoiler information about the solution

  • 1733057?v=3

    so far marked as fixed

  • 1733057?v=3

    had a sorting problem, sorry for that.
    fixed it and added some simple edge case test.
    can you retry if your solution works now?

  • 7867810?v=4
    [ { from: '2020-06-10',
        to: '2020-07-08',
        title: 'A',
        tsF: 1591747200000,
        tsT: 1594166400000 },
      { from: '2020-05-11',
        to: '2020-06-08',
        title: 'B',
        tsF: 1589155200000,
        tsT: 1591574400000 },
      { from: '2020-06-18',
        to: '2020-06-18',
        title: 'C',
        tsF: 1592438400000,
        tsT: 1592438400000 },
      { from: '2020-05-22',
        to: '2020-05-24',
        title: 'D',
        tsF: 1590105600000,
        tsT: 1590278400000 },
      { from: '2020-05-14',
        to: '2020-06-16',
        title: 'E',
        tsF: 1589414400000,
        tsT: 1592265600000 },
      { from: '2020-06-07',
        to: '2020-06-26',
        title: 'F',
        tsF: 1591488000000,
        tsT: 1593129600000 },
      { from: '2020-06-17',
        to: '2020-07-05',
        title: 'G',
        tsF: 1592352000000,
        tsT: 1593907200000 },
      { from: '2020-05-22',
        to: '2020-06-07',
        title: 'H',
        tsF: 1590105600000,
        tsT: 1591488000000 },
      { from: '2020-05-23',
        to: '2020-07-03',
        title: 'I',
        tsF: 1590192000000,
        tsT: 1593734400000 },
      { from: '2020-06-22',
        to: '2020-07-29',
        title: 'J',
        tsF: 1592784000000,
        tsT: 1595980800000 },
      { from: '2020-05-14',
        to: '2020-06-01',
        title: 'K',
        tsF: 1589414400000,
        tsT: 1590969600000 } ]
        
    expected [ Array(18) ] to deeply equal [ Array(10) ]
    
    ==== Expected ====
    [ { from: '2020-06-07', to: '2020-06-08', title: 'F' },
      { from: '2020-06-09', to: '2020-06-09', title: 'F' },
      { from: '2020-06-10', to: '2020-06-16', title: 'A, F' },
      { from: '2020-06-17', to: '2020-06-18', title: 'A, F, G' },
      { from: '2020-06-19', to: '2020-06-21', title: 'A, F, G' },
      { from: '2020-06-22', to: '2020-06-26', title: 'A, F, G, J' },
      { from: '2020-06-27', to: '2020-07-03', title: 'A, G, J' },
      { from: '2020-07-04', to: '2020-07-05', title: 'A, G, J' },
      { from: '2020-07-06', to: '2020-07-08', title: 'A, J' },
      { from: '2020-07-09', to: '2020-07-29', title: 'J' } ]
      
    ==== Actual ====
    [ { from: '2020-05-11', to: '2020-05-13', title: 'B' },
      { from: '2020-05-14', to: '2020-05-21', title: 'B, E, K' },
      { from: '2020-05-22', to: '2020-05-22', title: 'B, D, E, H, K' },
      { from: '2020-05-23',
        to: '2020-05-24',
        title: 'B, D, E, H, I, K' },
      { from: '2020-05-25', to: '2020-06-01', title: 'B, E, H, I, K' },
      { from: '2020-06-02', to: '2020-06-06', title: 'B, E, H, I' },
      { from: '2020-06-07', to: '2020-06-07', title: 'B, E, F, H, I' },
      { from: '2020-06-08', to: '2020-06-08', title: 'B, E, F, I' },
      { from: '2020-06-09', to: '2020-06-09', title: 'E, F, I' },
      { from: '2020-06-10', to: '2020-06-16', title: 'A, E, F, I' },
      { from: '2020-06-17', to: '2020-06-17', title: 'A, F, G, I' },
      { from: '2020-06-18', to: '2020-06-18', title: 'A, C, F, G, I' },
      { from: '2020-06-19', to: '2020-06-21', title: 'A, F, G, I' },
      { from: '2020-06-22', to: '2020-06-26', title: 'A, F, G, I, J' },
      { from: '2020-06-27', to: '2020-07-03', title: 'A, G, I, J' },
      { from: '2020-07-04', to: '2020-07-05', title: 'A, G, J' },
      { from: '2020-07-06', to: '2020-07-08', title: 'A, J' },
      { from: '2020-07-09', to: '2020-07-29', title: 'J' } ]
    
  • 1733057?v=3

    how to tackle all these different possibilities to import? ;)

  • 1733057?v=3

    Yes, the first sentence in the description was wrong. Sorry for that. This is now fixed and an image was added to outline this.

  • 1733057?v=3

    You are absolutely right. I adjusted the description to describe the ISO 8601 specification.

  • 11096661?v=3

    I think the description was wrong because the wiki says that whatever year the Thursday is in tells what year the week counts as. So on that one the thursday is in 2019 so the first Monday is the start of week 2.

  • Profile pic

    Hey there,

    at least for Iso 8601 the first calender week does not start on the first monday in january, but instead in the week containing the first thursday in january.
    Every calendar week starts with a monday, and thus has always a duration of seven days.
    Please consider taking that in your Description.

    Alternatives like in USA (at least believing the german wikipedia entry) start exactly at the first of january and result in the first week being shorter than seven days.

    If you'd like to set the scenario to "starting at first monday" consider adding the word: "asume".

  • 31424178?v=4

    Can someone tell me if I'm reading this wrong...
    The description says that week 1 starts with the first Monday in January. For 2019, the first Monday is January 7. Therefore, January 1 2019 is not in week 1, it should be in the last week of 2018.
    But the description and tests all assert that January 1 2019 is in week 1.

  • 11096661?v=3

    I struggled so much on this one and my solution is the ugliest one. Date problems are really hard for me, I got stuck on another date problem before not too long ago.

  • 1733057?v=3

    Yes, any corner/side touching boat is a killer criteria.
    Means, whole battlefield is not valid, tf. return false.

  • Loading more items...