Bloomberg interview question

used notes to map out a coding question. could not understand