Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
same for me, test case 8 has failed.
cannot understand where it went wrong.
Try optimizing your algorithm instead of listing every element in the sequence.
I run into a timeout with 123456790, while all other tests are passed.
Any suggestions?
Thank you bro!
Your hint is was on point! 🤝
.
Your code failed to handle duplicate values.
For example, let's use the collection
[1,2,3,2]
and theitems_per_page
is2
. The pages should be[1,2]
and[3,2]
. With your solution, if you dopage_index(3)
, it returned0
. Even though, the element fromcollection[3]
is put on page1
.So, it's a bug in your solution. Not a kata issue.
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
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?
That test expects False, your code is failing another test.
This comment is hidden because it contains spoiler information about the solution
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.
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.
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.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.