Divide and Rule: You are given with an array size and elements, need to remove any one of the elements, such that remaining elements has to divided into two halves and their sum should be equal, if both halves sum are equal need to return 1 else return -1.

Divide and Rule: You are given with an array size and elements, need to remove any one of the elements, such that remaining elements has to divided into two halves and their sum should be equal, if both halves sum are equal need to return 1 else return -1.



Input: 7                         //Array size
1   -----------------
2                         |
3                         |
4                         | -------Array Elements
5                         |
6                         |
7-------------------


Output:
-1

Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Multiply Negative numbers in java