Bloomberg Interview Question

Flatten a list, and do a weighted average