Ad
  • Custom User Avatar

    same for me, test case 8 has failed.
    cannot understand where it went wrong.

  • Default User Avatar

    Try optimizing your algorithm instead of listing every element in the sequence.

  • Custom User Avatar

    .

  • Custom User Avatar

    Your code failed to handle duplicate values.

    For example, let's use the collection [1,2,3,2] and the items_per_page is 2. The pages should be [1,2] and [3,2]. With your solution, if you do page_index(3), it returned 0. Even though, the element from collection[3] is put on page 1.

    So, it's a bug in your solution. Not a kata issue.

  • Custom User Avatar

    No need to be angry. Description does not imply clearly that both empty arrays should return True since they are technically the same in which your solution does not fulfil this criteria.

    a1 = []
    a2 = []
    test.assert_equals(comp(a1, a2), True)