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.
I tried to use intertools in former katas and it seems it's not integred in Codewars and there's no console to install it, heh.
omg wtf
This solution returns true when false is due for:
snattleField = [
[1, 0, 0, 0, 0, 1, 1, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[1, 1, 0, 0, 1, 1, 1, 0, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 1, 0, 1, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
Elegant but not correct!
Can I share a screengrab from my G Colaboratory to confirm this?
That is actually just- 6 lines???? HOWWWWW
WHAT, 6 LINES?!
"Everything you want, it's already there in a library somewhere"
And this is the exact representation of it.
It's no bad thing to import modules if they get the job done! There's a time and a place for code golf. That said - with the distance of several years' hindsight - I should probably have added a short comment.
Really nice! I saw someone else use a for-loop with an xor operator (i.e. "^") which is similar and doesn't need an import. I like this the best because it is O(n) and it is very clean. It's a bit more arcane than the simplest solution, but for large values of N this is definitely the right approach.
Good work :)
The code you have written is exceptionally elegant
I found it. Thanx
Elegant solve. Thanks for the commented version -- most insightful.
Not sure if linking comments works here but there is a reply to MrSoto from a few years back where I expand the code with line by line explanation. Can expand on that if it's unclear, although it's been a while :-)
Would you mind to explain what your code is doing ?
Hold On !
Bro is living in the matrix
Loading more items...