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.
Chat-gtp or a similar llm is usually a good explainer of code.
ignore this comment
lmao, right? Always something.
break it down.
It's basically:
for i, c in enumerate (s): etc...
how did you find the original number producing this outcome? how did you know it was 73567465519280238573 that leads to that event?
where is this info?
These are called list comprehensions
ffs...
where do people learn this one liner syntax i see everywhere?
my feeling exactly. i did this. how does one get to the one liners?
what level is the person who writes this?
my code was 20 lines.
i have no idea how this works. any pointers/explanation?
This comment is hidden because it contains spoiler information about the solution
they say so in the problem description
I think it would require, at a minimum, a lot of familiarity with the built in functions and their useage. Like in this case enumerate() and .join(). Because I'm unfamiliar I went straight to using a for loop and f strings.
That's one of the reasons I do these challenges though, it introduces useful things like enumerate() and how they can be used, or reminds you if you'd forgotten.
While not claiming that these types of solutions are necessarily best-practice, (and I am guilty of many of them), I will nonetheless assert that the inherent challenge to a coder unfamiliar with such constructions is rather useful; in that one needs to unravel the code, often using the google, and by the end of it will have learned 1 to 5 new concepts appropriate either to that one language in particular, or to coding paradigms in general.
Loading more items...