Q:

Sum of numbers in array

I am new to programming and I try to solve problems in online-judging system. There is a problem, which looks very interesting and important, but unfortunately I have no idea how to solve that. I would appreciate any hints.
Here is the problem: Given an array as an input. Print 1 if there are two subarrays, which have the same sum of numbers, otherwise print 0. 
Input:
2
1 1
Output:
1
Input:
3
2 5 3
Output:
1
Input:
3
1 4 7
Output:
0
Thanks

A:

This is known as the partition problem (or at least a variant of the partition problem). It's a problem that requires what is called a dynamic programming solution. This is a pretty advanced problem for someone who is just beginning to learn how to program. I advise starting on some easier challenges.
If, however, you are interested in tackling this beast, check out this link: http://people.csail.mit.edu/bdean/6.046/dp/. The link on this page to the 'partition problem' shows a video explanation of a working solution.

