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.
nice
In short( Extremly short) the [:size] is slicing it until the number you put there so if it's 6, the output is up to index 6 but not included (remember the index in python starts at 0)
so it '10' * 6 and it omitts the 6th index.
Isn't the standard form of generator expressions like 'x for x in something if condition else'? I get a syntax error for 'else' using this and only when I moved the if condition first was I able to get results
This comment is hidden because it contains spoiler information about the solution
Well, I'm not C++ coder, but as far as I remember, it doesn't look like "good style code" on C++. Also comparing to literal languages is kinda wierd imho, bcs there's no performance quality for speach)
Do you know how can I compare those solutions (mine and this) by performance? Bcs my mentor saying that performance is the most important moment for coder.
Consider this: could you form a sentence based on what you see in the one-liner? Yes. How would is sound if you formed your solution into literal language? More like a paragraph?
I'm not putting judgement on your solution. I'm only considering what it might be like to really consider what readability means.
Fo a lot of coders, a one-liner like this quite easily tells them everything they need to know all at once.
Looks like it's really cool to know it as a feature, but ihmo it very unusable code, at least because it hard to read
Use proper code formatting (triple backticks) please.
I ran some benchmarks. This solution is faster than the "efficient" alternatives for "small" to "moderate" length strings; but as the input length increases, the difference between them shrinks until the efficient methods scale better for much larger strings. If you technically know you'll be dealing with short-ish strings, this can actually be faster.
This is clever but calling count every time is not good at all. Why do people put this as best practice.
Why people think one line solution is that good? Hard to read and debug if needed
the same as mine
that is a good solution!
Clever done!
damn, gg, i had the same sol
Loading more items...