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.
A valid ip but not in this kata
Super concise and enjoy the use of str_repeat from matches.
It really can be just in one row))
i am confused, kata was with regex tag, so i am avoided this solution
I like this one as is more faster and easy to read, splitting the array_map in a separate variable :)
That moment when you spend 30 minutes thinking about all the cases and then you see this :))
Okay, weird, because it was the first solution I tried and it errored out on the 0.0.0.0 test case so I went way off board with a worstCase if solution. :D
I also added IPV4 only flag and it didn't make a difference.
It worked just fine for me.
This solution doesn't currently work.
that was my first idea but then I decided to use preg_match_all since it returns the number of matches and there is an 'i' modifier.
IPv6 is still a valid IP ;)
This comment is hidden because it contains spoiler information about the solution
Eval for people with no brain in their head...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...