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.
BIG O(n) BABY. LETS GO!!!!!!!!!!!!!!!
low amount of lines but time complexity higher than mine :P
Even tho you most likely won't see this, but hate to break it to you - not everyone cares about coding principles - if you can do something in one line of code and it is not very unreadable, a lot of people will do just that and most people are fine with that.
In production and development codebases for huge apps - of course its better to keep things simple and readable, but if you can condense two or three loops to just 1-2 lines, but then explain the choice in documentation - thats way better.
g for global, which is used for pattern literals right?
and i for CASE-iNSENSETIVE?
This is literally me when I started coding.
Comments:)
This comment is hidden because it contains spoiler information about the solution
wow bit shifting so clever
if you are wondering why i calculate some abstract "len", its cause i am sleep deprived RIGHT NOW, but you know...
C AIN'T WAITING
The
String.split(String s)
splits the string into an array of strings in places where there is s in the original string. So you have something like"hello world!"
, and if you do"hello world!".split(" ")
it will split the string into an array like this:{"hello", "world!"}
Then with the
[0]
he is accessing the first element of the array. 0 is the first element in Java and you access array elements by an index with square brackets, remember!Thanks for your explanation.
I saw the comment, but I forgot the size is specified in the declaration, so I basically was like "you give me an array, but the memory is not allocated yet", which is wrong, thanks!
I am doing codewars fundamentals only right now, in between reading "The C Programming Language", and I am only on chapter 2, so yeah I know nothing about how all this stuff works.
bruh. its not specified so i calculated the size and allocted that much with malloc
are you dynamically adding more space to the array with the *integers++?
Базар брааза
Glanced over, and yes its the same algorithm. Yet it still looks better than my stuff lol
I had to implement addition by columns like in first grade, you know? For this to work...
Is this code the same type of thinking or what? Cause I don't feel like looking up libs you used
Loading more items...