Two days ago we looked at the first Idea I had to write an algorithm for duplicating each bit in a file. However, this turned out not to actually be that fast, and a friend of mine wrote a much faster algorithm. The goal of this challenge is simply to implement the rust function below to run as fast as possible. There are 3 implementations to compare to: A naive SISD implementation, an optimized SISD implementation, and an optimized SIMD implementation.
The function should insert a copy of each bit next to itself. An example of what the function should do is provided bellow:
Oh also just to make things more fun you don't have access to std. We reimplemented print line using assert so you can print but only once per run ;).
Since this question requires compiled code it uses a server to run the code. Please shoot me a DM if it breaks
Output:
Need a hint? Click below:
More hints? Click below:
Final hint? Click below: