Is this a discovery!? I'm 100% sure I wrote when I first started programming and obsessively tried to get the shortest solutions on codewars.
> It is difficult to imagine that this algorithm was not discovered before, but we are unable to find any references to it.