Bloomberg interview question

Flatten a list, and do a weighted average