Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Confused by the logic of how the days are being added.
    I'm adding 1 in the following to include the first day represented

    test for [[2,8], [220,229],[10,16]] expects 24, so the following works:
        (8-2) + 1 = 7
        (229 - 220) + 1 = 10
        (16 - 10) + 1 = 7
        7 + 10 + 7 = 24
    

    However

    test for [[2,8], [6,16],[17,26]] expects 25, so adding 1 fails:
        (8-2) + 1 = 7
        (16 - 6) + 1 = 11
        (26 - 17) + 1 = 10
        7 + 11 + 10 = 28
    

    In the former, the +1 step works, but in the latter, the +1 fails and the removal of this step gives us the correct result.
    There's probably something basic I'm overlooking!?