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.
I don't know how to submit test cases, I didn't even know you could.
@docgunthop A 5 width 5 height plus sign shaped mountain range test case catches stepping out horizontally and vertically to calculate the mountians height (the center would be 3 not the correct 2 in that case). If you also check that there are mountains in diagonal directions after the initial step out this approach works.
Since stepping outward to calculate height is not the exact intended out-to-in step-by-step birds algorithm it can be argued this test case isn't necessary, but I saw complaints in the other katas comments with similar misunderstandings. So while the instructions CAN be interpreted as intended, in practice they often aren't which indicates that there is room for more clarity on what is being asked. With any sort of technical writing (in this case an illustration), rather than blaming people for misintepreting it (rtfm attitude), it's worth considering that the writing can be improved so that people are less likely to miss those "obvious" details that the rtfm attitude is dismissive about. It's very arrogant to take the stance "you misunderstood my instructions, therefore there must be something with you" (ie: "So where is the problem? It sounds self-inflicted."). Others have also misinterpreted the instructions so they can be improved.
In both this and Bird Mountain the example terrains can be solved with an algorithm that just steps outward vertically and horizontally from a mountain and if in all directions there is still a mountain it increments the height (ignoring the rule that diagonals can't be more than 2 steps lower than the mountain).
This fails some of the actual tests (because of the diagonals) and is an indication that there is not enough information to solve the problem from just the description.
I really liked the kata though!
This took me a long time but it was fun :)
In JavaScript the random test cases pass but on the they UI show up red making it look like the tests are failing. I was trying to see why my solution didn't work before realizing that the tests actually passed but where just showing up red.
I mean after seeing the simple clever solutions it feels bad to make this argument but since most generic attempts require some sort of performance tuning I feel like this would be more appropriately ranked as a 5kyu. I find it rare that a 6kyu requires performance tuning to pass the tests.
This only reinforces my concern lol.
Imgur was blocked on the internet I was one so I couldn't see the image so it should be clarified that it's 4 in a row.
I did a lazy hard coded solution with lots of boolean checks rather than using increments and decrements on the x, y, and z coords and had to rewrite it :(
At least I got better at using multicursor though
It doesn't clarify 3 in a row is the win condition anywhere in the instructions. It should say that just to be clear. With the board being 4x4x4 people could write an entire 4 in a row solution then run the tests and have to do a bunch of work to fix it.
fun fun fun
What are the pitfalls of quick select (or did I do something wrong in my implementation other than not randomizing the pivot)? Is it stack overflow because I wrote it recursively or is it something else that happens with larger arrays? What are some better algorithms for solving this problem with very large arrays than quick select? Quick select is the only algorithm i've heard of that has average linear time complexity for getting the nth largest element.
Well I wrote a quick select because I remember hearing about it randomly at somepoint, useless for a 7kyu but I wanted to try it out at least.
It updated now thanks!
Is there a way for me to have the solutions I did before I got Codewars Red show up on my stats?
I was waiting until I got to 2kyu to get Codewars Red and I just got to 2kyu and got a 6 month subscription but looked at my profile and have 0 Completed Kata for all of my langauges.
I finally got it but it's the most disgusting ternary i've ever written lol.
This one was tough for me.
Fun kata and pretty tough for me. After looking at other solutions that do the same thing I did but with many less lines and conditionals I think i'll try to run a token parsing pass first rather than using while loops and indexes within the string next time I have to do parsing like this.
Loading more items...