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.
My first Solution was in fact to compare every element of b with the squares of a. XD After reading this comment, I thought about a better solution and wrote a second solution with a hashtable. I think, that is the most efficient way. Well, maybe not my implementation. ;)
Thanks anyway for the inspiration.
If you compare b to a without sorting it would be O(n^2), with sorting it's O(2nlog n + n) = O(n log n) which is better for large arrays.
:D
@Sourdough, what's about this?))
Thanks!
This solution is amazing.
Damn it made me sweat a bit. But solution was worth it!
pat pat~
I think it is a bit more complex than that.
Things are even better! By eiπ = -1, you can have a positive number, raise it to a positive(?) exponent, and get a negative result! How cool is that!
Well, kinda. All it takes is some... imagination.
Literally everyone of us, with some kata, at some point of time
After 2 hours of trying to figure it out myself
Giving up and came here to search help
I notice wikipedia article - Complex Numbers
Quickly reading contents trying to make sense of it all
I dig deeper into imaginary unit article
After hour I understand what's going on
After 30 minutes the code is ready
Runs without any problems and I submit
See solutions
Crying out of misery
This comment is hidden because it contains spoiler information about the solution
I love while loops
I didn't know about asprintf :S Did malloc variant but it didn't work at cw.
Loading more items...