Ad
  • Custom User Avatar

    One can actually inherit from an inner class. It's a little very wordy, but it should work

  • Custom User Avatar

    Test information is .. sparse. The tests really could use better messages

  • Custom User Avatar

    Please describe what exactly is meant by "rotation" it's not clear from the context and word alone.

    Also test-cases don't give nice information about what went wrong.

  • Custom User Avatar

    Oh sorry... I was talking about java

  • Custom User Avatar

    If I don't know what language you're talking about I can't help.

  • Custom User Avatar

    I personally find the index solution somewhat cramped and clunky. I'll need to revisit this later. This can definitely see some improvement on the caching and lazy loading part.

  • Custom User Avatar

    This kata needs an overhaul. test-cases don't check for an incorrect return of 10, and the method shouldn't be named in snake_case....

  • Default User Avatar

    Well, I'll do that when I have enough time:-)
    Thanks for the feedback!

  • Custom User Avatar

    The parameter names could use a little improvement.
    The requirement of an empty string should IMO be pronounced a bit more, possibly by adding it to the initial test suite.

    Aside from that, very nice challenge

  • Custom User Avatar

    Thanks for your solution! I'll mark this as resolved. :-)

  • Custom User Avatar

    Nice kata! I had very little exposure to Java8 streams API and I learned some interesting things with this one.

  • Custom User Avatar

    Thanks for the feedback!

    Before I made this kata, I solved several others that would have been easy without performance constraints. For example, generating Fibonacci numbers is trivial, but to compute the millionth Fibonacci, you have to come up with a much better algorithm.

    I thought the problem wouldn't be interesting if I made the tests too easy, but you are right: This kata should be about a useful (and hopefully interesting) application of streams. Performance should be a secondary concern. I disabled the 3 million test. The hardest test now expects 1 million primes. I'm looking forward to your solution!

    For the record: The best solution so far can generate over 40 million primes in under 7 seconds on the Codewars server.

  • Custom User Avatar

    Hello There,

    I have gotten this kata to pass all test-cases but the last one.
    I personally think skipping 3mil. Items in a ORDERED Stream in less than 10 seconds is a too heavy performance requirement :(

    Then on the other hand I am not that good at performance intensive Programming.

    If the goal of this Kata is primarily to focus on the performance aspect of calculating primes, that's awesome.
    If the goal is to properly leverage Streams, then the last test case is too brutal for this kata.

    Very interesting Kata, though, thank you