Ad
  • Custom User Avatar

    O(N)? But the number of elements in the result is O(len(arr)^2), so it must be bounded below by O(N^2). Or is this a different N from the length of the array?

  • Custom User Avatar

    The tests are not very helpful. Not sure if you have control over that or not--I used to make katas years ago. But we used to be able to put a message into the test so it actually said a bit about what it was testing. Just getting "it should've been this other number" isn't useful as a message. And it seems only the last test is shown or something?

  • Custom User Avatar

    Oh man, it was a real struggle to understand what I was even meant to do. I think it's just how it was explained.

    The way I would explain it is:

    (Calling this a "first maximum rising sequence" is super wordy and confusing, so I've renamed is to "flush" for demonstration purposes.)

    cards is an array containing integers in a random order.

    To form a Straight, start with the first card in the list. Find the next later card in the list that is greater than the previous card in the Straight. Keep adding cards like this until no more can be added.

    No cards used in that Straight may be used in another Straight. Keep making more Straights always starting with the first available (unused) card.

    Return how many Straights you can create from the set of cards you are given.

  • Custom User Avatar

    .. always choose the first rising element ..

    If this is intended to convey "you have to be eager constructing your subsequence", it's not working. Not helping is that that should be "chooses".

  • Custom User Avatar

    Why is this tagged iterators ?