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 believe floating-point operations are unnecessary there
This comment is hidden because it contains spoiler information about the solution
I know that solution is older than 2 month I was talking about answer of people that visibly test the solution with success and so are probably still using python 2 (see answer of Seawolf159 or gsrus.russian.hacker)
This solution is probably older than two months. It's possible it was submited when only Python 2 was available on CW, and there were no Python 3. Now Python 2 is not available anymore, and solutions using Python 2 cannot be submitted.
Solutions from old language versions are not automatically invalidated, that's why you can still see them and they still attract upvotes.
yes i know it s due to python 2. But normaly if you fix in doiing a list of the zip that works but here its not the case...
I find also strange that still 2 month ago people are still using python 2...
code wars should obliged to put teh verison of the language used to solve the prob
There is something called python 2. Also, it is invalidated
AttributeError Traceback (most recent call last)
in
----> 1 snail(array)
in snail(array)
4 a.extend(list(array.pop(0)))
5 array = zip(*array)
----> 6 array.reverse()
7 return a
AttributeError: 'zip' object has no attribute 'reverse'
that code does not work at all. And if you change the code with 'array = list(zip(array))' give a false solution !!!
yeah.. I'm looking at how this visually works step by step and I get it (which is good) but I would have NEVER thought to do it this way. I think my brain is still thinking of things in terms of brute force methods. My method loops around in a circle over and over until all list items are used up without ever repeating. This method is like flipping a switch. "add a line, delete the line, flip a switch(move everything), reverse it and repeat."
when yo uwrite sum of every row you can notice that. It's not that hard.
But did you test it with big inputs, or just run it on a 10x10 array and called it a "success"? With a 400x400 array B4B's solution is 5 times faster than this one, and there're even better solutions out there.
It is actually faster than your solution by a fraction of a second though, Blind4Basics :) I have just compared them and mine wins by 100 ms or so (somewhere at 1050 vs. 1150 ms). Can you show me a solution that actually is faster than this one? I do not insist it follows the optimal algo, but I'd like to have a look at something that is efficient.
t's still quicker than mine.
you'll reach 1 kyu. One day. If you're persistent. And on your journey there you'll realize how much this solution is actually especially "bad" (performances-wise speaking...) ;)
Compared to my solution this one is so beautiful and amazing! How did you even figure that doing it like this would work? Even after going through some array sizes on my own to see how it works, i still don't really understand why it works the way you want. I just can't figure out why it goes from taking the last of every column to going to entire roes and how the one you want is alwasy at the back... Does this mean i will never reach kyu 1?? :(
spoiler flag, plz...
Loading more items...