Belvedere Trading interview question

Was sent a math and coding challenge.