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.
First off, you made this thing, and it was really cool, and I'm really happy you made it, so thanks! I enjoyed the challenge, so please read the next few sentences in a happy, considerate, soft voice :)
This is 100% not your responsbility, but it seems like a small change to make (changing the number in 2 places) to make it easier on future users, and that seems like an easy win to me.
I understand why you can't change this now, but
Makevalley
is wrong. The termmake valley
when snake cased ismake_valley
(word separator is replaced with underscore) and when camel cased isMakeValley
(word boundary is marked by capitalization). So while it makes sense that you can't change it, that's why I found it hard to remember/type.Me neither, but I thought it was worth mentioning.
Because the object is not just to have the number in the left wing be larger than the equivalent number in the right wing, but also to be as close as possible. So in your example
[79, 54, 35, 19, 25, 35]
is incorrect because79 - 35
is larger than79 - 54
, or to put it another way, the largest number in the array should always be on the left outermost, and the second largest should always be on the right outermost, and so on and so forth until you get to the minimum in the middle.Couple of issues with tests (at least in elixir): If you want to test something like
[77]
as an input you should make the number larger, outside of the unicode character range, so that in tests you don't get failures like:lhs: 77, rhs: 'M'
That test failure is very unhelpful for begginers in elixir.
Also, in Elixir, could we please call the module MakeValley as would be convention?
Makevalley.make_valley
is offputting to type and harder to remember. Also, I was getting an intermittent failure where the minimum was sometimes included twice, but it's unclear why. I believe this was only with the random tests on larger lists.