LinkedIn Interview Question

sum of nested weighted intergers