A team has a list of tickets with effort points in efforts. They want to split all tickets into two sprints so that both sprints have exactly the same total effort. Every ticket goes into exactly one sprint.
Write canSplitEvenly(efforts) that returns true if such a split exists, and false otherwise.
Input: efforts = [2,6,13,5] Output: true
Sprint A gets 2 + 6 + 5 = 13 and sprint B gets 13.
Input: efforts = [2,3,4,6] Output: false
The total is 15, which is odd, so it can't be split into two equal halves.
1 <= efforts.length <= 2001 <= efforts[i] <= 100Run 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 #512 Two Sprints of Equal Effort. 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.