A team has n reviewers and n open pull requests. cost[r][p] is how many hours reviewer r needs to review pull request p. Each reviewer gets exactly one pull request, and each pull request gets exactly one reviewer.
Write assignReviewers(cost) that returns the smallest total number of hours.
Input: cost = [[9,2,7],[6,4,3],[5,8,1]] Output: 9
Reviewer 0 takes PR 1 (2), reviewer 1 takes PR 0 (6), reviewer 2 takes PR 2 (1).
Input: cost = [[5]] Output: 5
One reviewer, one pull request.
1 <= n <= 15cost.length === n and every row has length n0 <= cost[r][p] <= 1000Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #557 Assign Reviewers at Least Cost. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.