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.
Great improvement, particularly on the random tests. In fact my solution now fails, so I have to debug it. Might take some time before I can confirm that your solution is right and give the kata a rating, but I will try to get to it as soon as I can.
There are still 2 issues. The sample tests are still using print statements instead of test assertions. So actually any code will pass! It's very important to fix this.
Also, the description doesn't display the way I think you want it. It's HTML, so spacing is ignored. So for example "Mathematical Definition:" ends up as on the same line as the previous sentence, so it looks like this:
The goal is to minimize the sum of squared differences between each original value and its representative value. Mathematical Definition:
Similarly, the constraints end up on the same line, not on separate lines as you typed them.
Use HTML tags in your description to display things the way that you want. And click on the Preview tab in the editor to see how it looks.
Thank you for the feedback. I have made some improvements. Let me know what you think.
Hi Riffe01,
This is a great problem, but I think you've provided too much information on how to solve it. It takes some of the fun out of solving it! I suggest removing the "How to Approach" section. Describing the task and giving the examples is enough. Adding the tag "Dynamic Programming" provides a helpful suggestion on what approach to use. It's worth looking at other problems with the "Dynamic Programming" tag, to see if any of them are similar to this one.
The sample tests shouldn't print the results. Use the same style of test assertions as in the hidden tests.
It needs real random tests, which change every time somebody submits a solution. If you look at the solutions which have been submitted, you'll see that one person hardcoded the answers! Obviously that should not be allowed to pass. The only way to avoid that is to have real random tests. Look at some kata that you have solved and that have high satisfaction ratings and take a look at how they did the random tests. Also read Writing Submission Tests. It also needs tests with bigger lists, both fixed and random, to prevent a brute-force approach from working.
I didn't give a difficulty or satisfaction rating yet. If you address these issues I will do so.