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.
That dogma is barely true in toy problem exercises, and complete nonsense in actual industry work.
Lengthy comments, which might not get updated when circumstances change, can be a negative thing. Clear and concise comments, which explain the reasoning behind a step that might not be immediately obvious, are always professional and will be appreciated. Either by a colleague, or by yourself when you're trying to recall your own thinking 6 months later!
Thanks!
This is single most confusing Kata I've ever gone through on this site.
The instructions indicate that for words ending with a vowel, your code should:
No spoilers about my code, but the tests fail on the word "szaru".
Could this be a bug in the test suite implementation for Groovy? Or am I just really missing something in these vague requirements? I'm producing what appears to be the correct value, but the tests fail regardless.
Oh good grief.
I started out with a query identical to the top-rated solution, but couldn't get it to work right. I assumed that the root problem was the result set's
department
column having the same name as the actualdepartment
table.It turns out that that I simply had a typo, and was joining
department.id
tosales.id
, rather than tosales.department_id
.So frustrating. I hope that no one sees my solution here and thinks I was doing something "clever"!
I don't know, calling this one even "7 kyu" might be a bit too generous. It's taken straight from the "CREATE FUCTION" page in the PostgreSQL documention, with the solution being the second example verbatim!
This sort of "5 kyu" kata are the worst. :(
Really, "8 kyu" for the trivial programming... and "3 kyu" for the arcane math concepts if you're a few years out of school.
The best challenges are the inverse.
This comment is hidden because it contains spoiler information about the solution
To satisfy the original function definition, you could just append
as u32
to this one-liner. I did something similar, but only because this is such contrived toy problem. You'd never want to do that in the real world, becauseusize
can vary across platforms and therefore assuming that it can always be cast asu32
would be very brittle.Unnamed is right, this might as well be considered a typo by the kata author. However, I too am surprised that the system allowed him to get away with just changing the function definition.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution