Okay, I reviewed this and think I got your point. I can see your solution and it looks a bit more readable than your suggestion up here (no need to import operator).
However, I think I can see a way to improve this even further, but dumping sorting altogether - because we actually need only min and max! I'll make a new solution now.
That may be another way to solve it, but what is the real benefit of this? Is it performing better than my solution? Is it more readable? (I don't know - I solved this long time ago, but can you answer these questions?)
numyp.r_[l]
is similar tonumpy.array(l)
: It convertsa
(and, implicitly,b
) to a numpy array:It seems I was just a little bit less clever than tommur.
Thanks for the advice.
Okay, I reviewed this and think I got your point. I can see your solution and it looks a bit more readable than your suggestion up here (no need to import operator).
However, I think I can see a way to improve this even further, but dumping sorting altogether - because we actually need only min and max! I'll make a new solution now.
P. S. Check this out: https://www.codewars.com/kata/reviews/564a4614ece085b89b000051/groups/5a5bbb905c770dc6e7000019
That may be another way to solve it, but what is the real benefit of this? Is it performing better than my solution? Is it more readable? (I don't know - I solved this long time ago, but can you answer these questions?)