Number of Ways to Earn Points
CodingPhone ScreenMachine Learning EngineerReported Oct, 2025
Examples
Example 1:
Input: target = 6, types = [[6,1],[3,2],[2,3]]
Output: 7
Example 1:
Input: target = 6, types = [[6,1],[3,2],[2,3]]
Output: 7
There are types.length question types in an exam. types[i] = [count_i, marks_i] means there are count_i questions worth marks_i points each.
Return the number of different ways to score exactly target points, modulo 10^9 + 7.
1 <= target <= 10001 <= types.length <= 501 <= count_i, marks_i <= 50Reported as LeetCode 2585 in a machine learning engineer phone screen.