Equal Lands
Story
Zumbania is facing a series of land disputes in their Northern border. To avoid war an agreement was reached to split each land evenly. Each disputed land consists of a series of properties of different sizes. Can you determine if each land can be divided in half equally without splitting up any individual property?
Challenge
Given a list of numbers (representing the area of different properties), determine if it can be split in two parts so the sum of each part is equal. Print true
if it can and false
otherwise. The numbers must remain in the same order.
For example, 1 2 3 6
can be split after the 3 so there's an equal sum on each side (6), but 1 1 2 3 5
cannot be split anywhere equally.
Please sign in or sign up to submit answers.
Alternatively, you can try out Learneroo before signing up.
Comments
Can anyone possibly rephrase the Challenge for me? I seem to be misunderstanding the concept.
Learneroo
Jan 26, 7:40 AMIt's just asking if you can split a given list of numbers into two parts with the same sum in each part, without changing the order.
Ah, gotcha! Thanks.