It's not pretty, but I'm beat again. Learning functional programming has ruined my golfing ability.
hey..can u look out for adding new test cases!
You can save one byte by using an operator different from the !=, but it's not well defined whether or not that's the desired behaviour, and I don't want to take any steps towards turning this into a solution remotely resembling lambda*_:532. If you make a fork that changes something other than that and improve the rules in a way that allows a shorter operator to be used, it might be a good thing to copmare against a hypothetical one byte shorter version of this that utilizes the < operator.
Is it possible with PriorityQueue too?
This is epic
Named values are clearer than tuples IMHO : convert ad convert, which one is a in a*x + b ?. Actually, NamedTuple would be even better
After some basic searching to see whether this idea was original, I found https://juliapackages.com/p/polynomials. I won't unpublish this or anything because this was good practice, but I probably won't add to this.
That does work and is quite a bit nicer, but the original problem statement said to create a copy of the array. That's a pretty pointless condition that doesn't even get tested though, so the default arguments should probably be used in a slightly tweaked better version of this Kumite.
You can use
function insertionSort(arr, i = 1, j = 1)
and you would be skipping the first if.
I like it hahahaha. I think it has Kata potential.
will look over this one a bit more tomorrow and maybe make a kata draft.
I'm trash at probability, so I'm almost positive mine was wrong. I did (1/9)^12, but then did something weird afterward. I can't really remember what it was, but I think it was something like this:
(1/9)^12 = 3.5407062e-12
Then I like multiplied it by 1000000000000
And then divided something that I don't remember.