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.

  • Default User Avatar

    I run into a timeout with 123456790, while all other tests are passed.
    Any suggestions?

  • Default User Avatar

    Thank you bro!
    Your hint is was on point! 🤝

  • 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.

  • Default User Avatar

    WTF is wrong with this kata?

    Always only one error. In my local env I get exactly that value, what the error message wants to have.
    After running the same code here, it comes always to that one error.

    Fixed tests
    Sample tests from description
    (9 of 9 Assertions)
    Basic tests
    (20 of 20 Assertions)
    Edge case: List [1,2,3,4] with 4 items per page
    (7 of 7 Assertions)
    Edge case: Empty list
    (8 of 8 Assertions)
    Edge case: List [1,2,3,4] with 1 item per page
    (12 of 12 Assertions)
    Completed in 0.76ms
    Random tests
    List with 43 items and 33 items per page
    (4 of 4 Assertions)
    List with 25 items and 25 items per page
    (4 of 4 Assertions)
    List with 43 items and 30 items per page
    (4 of 4 Assertions)
    List with 39 items and 48 items per page
    (4 of 4 Assertions)
    List with 45 items and 48 items per page
    (4 of 4 Assertions)
    List with 20 items and 26 items per page
    (4 of 4 Assertions)
    List with 35 items and 41 items per page
    (4 of 4 Assertions)
    List with 27 items and 14 items per page
    (4 of 4 Assertions)
    List with 35 items and 36 items per page
    (4 of 4 Assertions)
    List with 9 items and 7 items per page
    (4 of 4 Assertions)
    List with 26 items and 11 items per page
    (4 of 4 Assertions)
    List with 46 items and 67 items per page
    (4 of 4 Assertions)
    List with 29 items and 23 items per page
    (4 of 4 Assertions)
    List with 19 items and 16 items per page
    (4 of 4 Assertions)
    List with 21 items and 27 items per page
    (4 of 4 Assertions)
    List with 31 items and 40 items per page
    (4 of 4 Assertions)
    List with 8 items and 12 items per page
    (4 of 4 Assertions)
    List with 19 items and 17 items per page
    (4 of 4 Assertions)
    List with 7 items and 9 items per page
    (4 of 4 Assertions)
    List with 33 items and 34 items per page
    (4 of 4 Assertions)
    List with 49 items and 41 items per page
    (4 of 4 Assertions)
    List with 13 items and 6 items per page
    (4 of 4 Assertions)
    List with 36 items and 7 items per page
    Test Passed
    Test Passed
    Test Passed
    page_index is returning incorrect value for item_index 34: 0 should equal 4

  • Default User Avatar

    I suppose, this kata has an issue.

    I got in every try just one f** error, all other tests are passed.
    With my code in my env I get exactly the value, what the error message of this kata want to have as a right value.

    After I paste it here, there is always just one error. WTF?

  • Custom User Avatar
    a1 = []
    a2 = None
    test.assert_equals(comp(a1, a2), False) 
    

    That test expects False, your code is failing another test.

  • Default User Avatar

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

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • 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)
    
  • Default User Avatar

    I passed all tests except 1. I just don't understand what's going wrong. The description is not clear enough.
    Have anyone a tip for me? I am quite angry.