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.
And what about
float('inf')
?I'm fucking stupid and have started coding 2 seconds ago, can anyone explain how it works?
It is not covering all case scenarios and I think I will learn wrong because of that.
I wish there was a way to down vote solutions
This comment is hidden because it contains spoiler information about the solution
Right, thanks.
Done
Fair enough, changed.
Sincerely the bitwise operation was the first that poped in my mind, since the oddness of a number is determined by the last bit it seemed more natural (the n//2*2 I realized after), it was not for optimization.
It was not a total waste for me since I learned new aspects of the language, but it was for you which I am sorry.
It seems that in GO additive operators have lower precedence than shift operators, the source about operators in GO that I saw must be wrong, and I also only tested the equation in python.
Shit, forgot to use the var.
The length of the random arrays is n >> 1 << 1, which zero shifts all bits one place to the right and then 1 place to the left, thus removing the odd bit (the same as floor(n / 2) * 2).
Refactored. Let me know if there is a better way to do what I did
this would be even better if the arrays were outside of the function, so that they don't have to be generated anew every time the function is called
You can indeed read it somehow!
Maybe change the word "read" to "see"
In python any number that is different from 0 is considered True (inclusive negatives)
GO translation
Loading more items...