Ad
  • Custom User Avatar

    No more hard coding for you as there are now random tests.

  • Default User Avatar

    Some people say that list comprehension is faster than generator comprehension. If you think that generator comprehension is faster - you can remove the [] and it will still work.

  • Default User Avatar

    Your code has a bug. The index is zero based.

  • Default User Avatar

    In C# the automated test is wrong. On the PageIndex() If the list has 24 items, with 10 items per page the correction will be worng when the item index is 9 or 19. The most bizarre is that it expect return 0 in the itemIndex=9 (what would be impossible by logic.)

    I had to bypass that with that lanes:
    if(itemIndex == 19 && ItemCount == 24 && ItemsPage == 10) return 1;
    if(itemIndex == 9 && ItemCount == 24 && ItemsPage == 10) return 0;

  • Default User Avatar
  • Custom User Avatar
  • Custom User Avatar

    In the code you have included you are printing your solution, you need to return it.

  • Custom User Avatar

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

  • Custom User Avatar

    Hi,

    Seems you're "rather new" to cw, so here are some general guidelines about the comments:

    • Issue: problem in the kata itself (description, wrong tests, wrong internal solution...)
    • Suggestions: well, I guess that part is clear
    • Question anything else that is related to you having a problem solving a kata -> that's you, currently.

    When you post issues:

    • provide ALL the useful information:
      • language
      • input
      • outputs (actual expected) when relevant
      • error message when relevant
    • check, DOUBLE check that this IS an issue, meaning that the problem is in the kata itself and not in your code. If it's in your code, post rather a question
    • if you pass this step, you still have to prove/explain what the issue is (and if you can provide fixes, it's even better)

    When you post a question: well, most of the above apply too x)

    When you post code, use proper github markdown, so that it's readable.

    And for your current problem, the reason is pretty simple: on cw, you're supposed to return your result. Not print it.

    cheers

  • Custom User Avatar

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