Ad
  • Custom User Avatar
  • Default User Avatar

    That's right
    But if we'll look at tests again we'll see only strings (and lists of strings) as arguments... so IMO we should consider this tast as "strings"-exercise. And treat the task widly, like with real life tasks. IMO again.

    Thanks for your solution anyway.

  • Custom User Avatar

    the problem statement did not state that the case you described should return true. I think it's a safe assumption that the author only wanted a True to return if there was an exact match in the list, and false if there are only partial matches or no match at all.

  • Default User Avatar

    Very clever, but...

    In case of a string='bye' and a list=['bye bye'] it will return False

  • Default User Avatar

    Ok, thx! Learned something today!

  • Default User Avatar

    The kata is more targeted towards a paging as in memory paging mechanism, not to be mixed up with a page in a book. Here is a pointer: https://en.wikipedia.org/wiki/Paging. In computer science nearly every counting sequence starts at 0 (think of array indices for example).
    Concerning the test output, I agree.

  • Default User Avatar

    Maybe numbers are too big for JS and I would have to change them...

  • Custom User Avatar

    Javascript.
    And what I've found is that my sum, for large numbers, starts to be different from the correct value (I've checked it with wolfram alpha and also with a quick implementation in python).

  • Default User Avatar

    Which language?

  • Custom User Avatar

    I've optimized my solution (expanded the summation) but I'm still stuck with the expected value of 55100.
    Is there any clever trick that needs to be applied when we reach those huge values for m?
    Thanks in advance!

  • Default User Avatar

    I can't seem to get my code through the fourth submit test for python, although the given output is exactly the same as what is requested. Could you have a look at that?

  • Default User Avatar

    I improved the solution in other languages:-) Thank for the feedback!

  • Default User Avatar

    As a comment on my solution I explained how this problem can be solved without going through the entire series from i = 1 to n, just by applying a limited amount of equations. This results in a solution which needs less calculation power (I got around 2300 ms when going through the series, and around 1400 ms with the 'optimized solution'.) As you gave the suggestion to optimize the solution, this problem would just get that extra edge, and increase the difficulty slightly, if such an optimized solution was actually needed in order to fulfill the kata.

  • Default User Avatar

    I don't understand what you mean. Please can you be more explicit?

  • Custom User Avatar

    C# part doesn't work just yet. Good problem.

  • Loading more items...