AKUNA CAPITAL interview question

basic algorithm