Ad
  • Custom User Avatar

    (10, 2, [9, 6, 7, 4]) comes out to 'days: 1'
    (10, 2, [9, 6, 4, 7]) comes out to 'money: 10'
    To me the use of the word 'consecutive' is confusing. To me 1,2,3,4 (n,n+1,n+2,...) are consecutive numbers. If by consecutive do you mean that the numbers retain the same order as in the list,ie, that they should not be sorted, the I think you should state that the hotels are visited in order as shown by their cost, 9->6->7->4, otherwise I get the impression the hotels can be visited in any order.

  • Custom User Avatar

    Thank you for the valuable advice! This test has been added to the code

  • Custom User Avatar

    The word 'consecutive' was put in italics to make it more noticeable

  • Custom User Avatar

    The consecutive part of the task is illustrated by the test case (10, 2, [3, 7, 6]) -> money: 10