IMCD Group interview question

Financial related puzzle leetcode question