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.
For the benefit of anyone else reading, I worked as a programmer and was in a senior position for 12 years and level 4's are difficult for me, and it is humbling to see how much faster, simpler, and more elegant some others' solutions are (to put it mildly). Level 3's are definitely proving to be a different thing altogether. Point being, if you work in corporate IT you won't necessarily have to do a lot of the challenges here but it is important to be very thorough and accurate with what you do do. That means you might have 100 different source and target columns and mapping them all correctly. You can actually do worse in a corporate environment if you're too pedantic, don't communicate well, use too many obscure libraries/functions, and write unmaintainable code, even if your code is technically quicker and more efficient than a developer who's a bit more on the hacky side.
If you really want to work on the most cutting edge stuff at some place like Google... well, you've probably already got a CompSci degree from the likes of Stanford and you're not reading this post, but if you got to Level 4 without ever even doing this professionally for years I'd say you're doing very well. As for me, I've decided to go back into coding and am now trying to really master some of the advanced computer science topics and concepts that are really necessary for mastery in this field. Don't get too frustrated if you can't solve something like 7x7 Skyscrapers in a couple of evenings.
Bottom line is, technical skill is very important, but for most jobs, it's really only a part of the job. A lot of programmers quit the field within a few years of graduation because they had a misleading idea of what it is like to work in IT. Make sure you don't write just the most ooh-and-ahh inducing code on a place like this, but that your code actually works (and I'm not trying to be funny with that remark -- you'd be amazed at how much stuff ends up not even doing what it was intended to do in any way whatsoever), is accurate, is cleanly written, is documented correctly, is communicated and tested well, and that you're pleasant and agreeable: for the most part, you're going to be building fairly unsexy things and a working VW Jetta is a lot more valuable than a Ferrari without tires. If you really just like programming for the sake of it, it might be best to keep it as a hobby (or start your own business writing your own products).
It's a very egregious problem to say all test cases will be at least 5 in the description, but then the actual test cases (Python below) clearly start < 5. This also seems to be the case for all the other languages and is a pretty bad oversight. I'm going to give this a shot anyway since I haven't seen people have issues with the Python but on the off chance this ever gets viewed...
Test.assert_equals(spiralize(1), [[1]])
Test.assert_equals(spiralize(2), [[1,1],
[0,1]])
Test.assert_equals(spiralize(3), [[1,1,1],
[0,0,1],
[1,1,1]])
Test.assert_equals(spiralize(5), [[1,1,1,1,1],
[0,0,0,0,1],
[1,1,1,0,1],
[1,0,0,0,1],
[1,1,1,1,1]])
Test.assert_equals(spiralize(8), [[1,1,1,1,1,1,1,1],
[0,0,0,0,0,0,0,1],
[1,1,1,1,1,1,0,1],
[1,0,0,0,0,1,0,1],
[1,0,1,0,0,1,0,1],
[1,0,1,1,1,1,0,1],
[1,0,0,0,0,0,0,1],
[1,1,1,1,1,1,1,1]])
Another very clean, nice, straightforward kata from Mr. Kamau.
I've found that your katas tend to be ranked easier than I find to complete them. It's probably just me but it has been a noticeable pattern...
Cheers
Very nice kata, namely because expectations were crystal-clear unlike many of these that you have to re-read a dozen times to try to understand the author's requirements. I'll be looking for your other ones asap!
Thanks, I noticed that right after I put this in and passed the kata, apparently working too late here.
This Python test case does not seem correct, e.g., it's looking for two f and o characters in the second string but there's only one. Am I missing something?
Test.assert_equals(mix(" In many languages", " there's a pair of functions"), "1:aaa/1:nnn/1:gg/2:ee/2:ff/2:ii/2:oo/2:rr/2:ss/2:tt")
Very nice kata and my guess is I have the "unaward" for least elegant solution after looking at some of these here. It's the first Level 4 kata I passed and I spent a good two full nights working on it and was very satisfied to see it pass all of the random test cases.
This is for anyone else struggling with this as you might feel better after this schadenfreude that follows: I'm embarassed to admit this, but I spent probably 5 full nights on this problem and was unable to pass all of the test cases. (I apparently got lucky since I have just been coding Python regularly for a couple of months and have been able to pass most of the Level 5 katas with a single night of coding for the most part.)
I REALLY urge you to pay attention to the order of the indices before you start coding and not view that as an afterthought. My (lame) solution passed the bulk of the test cases as far as number returned, but I was unable to retroactively figure out a way to get the indices in the right order all of the time. I'm sure there's a way around this but after 25+ hours working on this I think I'm going to cut my losses at this point, and I'm wondering if I just lucked out and picked easy Level 5 katas before or if this one is just ranked a little lower than it should have (it seems like programmers 10 times better than I am have struggled a bit as well.)
Anyway, don't give up on my account, but if you're a little more on the beginner spectrum you might want to come back to this one after a few months and maybe something will click a bit more then.
I agree, the instructions on what indices to return are extremely confusing. I've read them over several times and still am having a hard time comprehending.
I'm also getting this error. I know my code is probably not awesome, but it did pass all of the sample tests and fails after 7582 ms so I know it's not just timing out after 12000 ms. I would think that with randomized execution of test cases it would pass at least a couple before failing...
Did you ever get this working? I think you're victimized by the same wacky "insert" discrepancy that I was.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution