Jane Street Interview Question

Extremly hard matrix manipulation problem.