• + 0 comments

    Ok so I have a solution that is passing some of the tests but not others. I cannot figure out what the problem is though.

    Here is an example. The answer for this set should be YES but I'm getting NO. Because from my understanding of the problem, NO is the correct answer.

    70 1958

    82 99 28 76 85 55 12 27 98 62 74 99 77 10 28 54 68 93 66 52 57 49 98 26 21 8 35 0 25 78 90 41 97 61 76 50 87 95 31 77 69 93 52 16 72 39 84 28 88 66 52 54 27 51 39 83 34 5 97 72 57 45 21 93 59 34 10 41 17 71

    And shown as a sorted array [99, 99, 98, 98, 97, 97, 95, 93, 93, 93, 90, 88, 87, 85, 84, 83, 82, 78, 77, 77, 76, 76, 74, 72, 72, 71, 69, 68, 66, 66, 62, 61, 59, 57, 57, 55, 54, 54, 52, 52, 52, 51, 50, 49, 45, 41, 41, 39, 39, 35, 34, 34, 31, 28, 28, 28, 27, 27, 26, 25, 21, 21, 17, 16, 12, 10, 10, 8, 5, 0]

    When added up, the two totals I get are 1960, 1956

    Since 1960 is greater than 1958 (the time it takes the guard to get back) the thieves would not be able to get out in time.

    Why is the test case showing that the answer to this should be YES?