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.
Good question. I'll look into it.
updated as above.
I went with your original premise and updated the description with a hint: somestring.count('')
So in the test cases, there is now:
I think I see what you are saying. If we say that sub-arrays must have length > 0 then
would be 0 instead of 1, which is mathematically incorrect
I don't like the idea of removing s = 0, though - that seems even more "special", requiring a special line of code (in solutions and tests) rather than a change in algorithm. I might have to agree with your original assessment to use the empty sets like the builtin does.
I would argue that logically, we should count at most one way to make an empty set.
For example, sum(xs[3:3]) doens't make sense for an array of length 3. By this logic, all of these return 0:
so there would be an infinite number of ways to sum to 0.
Would you consider this issue better resolved by stating in the problem that the length of the sub-array must be > 0 or by specifying that using an empty set counts as only 1 solution, even if it can be derived multiple ways?
I think it should be the latter because it makes sense that
should equal 1, not 0.
Added 10 smaller random tests
It seems like rolling_sum([1,2,3],0) should return 0 since there are no ways to make a sum of 0 with the integers given. You feel like that is not the proper solution?
All tests moved to new framework.
Removed all code in preload and moved it to new test framework
Awesome, thanks. I will check it out and update it.
Where can I find documentation on that?
Thanks. Issues fixed.
Isn't the whole point of writing an 8kyu problem that it is for noobs?
I don't really understand the point of your second comment. I'm sorry you think that teaching kids only produces garbage.
Well, I teach kids who are new to programming so they would solve it with for loops and (honestly) probably 62 'if' statements. That's fine for the first time, but I love the Katas that have several levels, so you are forced to think about how to make your program better. Just looking at the top solution doesn't really teach them how to come up with it on their own. So I was thinking of making a sequence of 2 or 3 problems where they have to improve their solution each time.
@Blind4Basics - the reason for part 1 is to give an easy introdution. I was going to add a part 2 with a maximum solution length of about 70 characters so that the user has to use a single join/filter/lamnda statement. Would that also be too boring/common?
Loading more items...