AKUNA CAPITAL interview question

Two algorithms/coding questions, three math questions