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.
Thanks, excelent tip!
Agree that
== True
should be left of, but i like the style otherwiseTrue, I don't remember why I didn't do that
There have already been an
(&)
function inData.Function
that do the same thing like(|>)
, so we could just writeI'll be honest -- mostly I try to somewhat golf these just for the fun and challenge of it. Performance is only a secondary consideration, but good observation about
nub
... although I guess for unrestricted strings, someone could throw in some UTF-8 and then you have a slightly larger N, but still the same time complexity of course :DI find DestyNova's algorithm very elegant. It's not O(n^2) because we are dealing with a string (a list of chars). There are only 256 diferent chars, so the list that
nub s
produces is never longer than 256. This makes the algorithm O(n).I do believe the
nub
function itself is not that efficient, possibly O(n^2). So as long as we use that standard library function, optimization is pointless anyway :pThis comment is hidden because it contains spoiler information about the solution
you mean len(odds) == 1