FunctionRacerProblemsRace

Weighted Row Scores

EasyNumPyPython

Each row of grid holds one student's marks on several tasks, and weights[j] says how much task j is worth. Return a list with one number per student: the sum of grid[i][j] * weights[j] over all tasks j. Return ints.

Example 1

grid [[1,2],[3,0]]
weights [10,100]
returns [210,30]

Student 0: 1*10 + 2*100 = 210. Student 1: 3*10 + 0*100 = 30.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems