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.
same here.
I do find descriptions of SQL tasks bit cryptic.
If you study mathematics or like math in general, the math related katas are fun.
If you are searching for a job or you are about to take a test, you are more stressed to learn and you're interested in the "useful" ones, so math related katas can be annoying in that case.
I had similar issues in the past. The thing that helped me was filtering katas, on the left part of the screen, select the appropriate tags.
That means rounded down, not rounded up like you did.
Apparently, sqlite 3.2.8 doesn't have those functions.
Excellent post/question - I have been wondering the same for a while.
IMO a one-liner lends itself well to this particular Kata. I had to admire how, in the top-rated solution, the author named the elements within each list of the data arguement. I myself used numbered indexes - a far less readable solution.
As a casual/hobbyist coder i have managed just fine without the "one-liners". However, when searching for solutions online I frequently encounter them and have difficulty reading them. So for that reason and because they look cool, I challenged myself to learn them.
During my research I learned that generators can use less memory, but may be slower to iterate through in certain instances but performance is rarely a priority for my scripts. Speed to acquire a working solution is usually the driving factor. Readability has become increasingly important as the population of scripts increases. Coming back to something I coded myself 6-12 months ago can take a while for me to digest.
Unless the application requires extremes in either memory utilization, performance or readability one should strike a balance between getting the job done with your available skill-set and writing something you or others need to understand long after the initial release.
I'm here to learn, so i see getting to grips with generators as an important step in the journey.
If the line can be read out-loud and it makes sense to me, i'm good with it. Squeezing code into an abtract expression to save on digits and get up-voted is not why i came here - but we all have different goals.
My sentiment exactly
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I was pondering about that too, allbudzeet20. Looks like VARBINARY is part of the SQL 2016 standard, but currently not supported by postgresql: https://www.postgresql.org/docs/current/unsupported-features-sql-standard.html (although it does indeed support
to_hex
).I see how these type of challenges can be benefitial, but I must agree, when I just want to practice my programming skills and not my math ones or necessarily learn new stuff at the moment, at least.
ok, I still don't get how a line gets cleared if there are 0 blocks in even one of the positions, I know L0 and R0 are the same position.
nevermind, didn't read directions carefully enough - going to try it again
yeah I had an input array that said the right answer was one, yet all positions had at least 2 blocks in them, therefore, 2 lines are cleared, not one I'm pretty sure.
so wait - if this in the input array:
['4L4', '1L3', '1L2', '1L1', '1L0', '1R1', '1R2', '1R3', '1R4', '4L4', '4L4',
'4L4', '4L4', '4L4', '4L4', '4L4', '1L3', '1L2', '1L1', '1L0', '1R1', '1R2', '1R3', '1R4']
how is that only one line cleared? every position has at least 2 blocks in it...
Yeah - I was having a bad night that night - unfortunately as far as I can tell there's no editing or deleting comments once they've been posted...
Loading more items...