suppose i have an array of n=5 elements say A={50,10,20,30,40}; when I pick i element from the array I can not pick i+1 element from the array. So how much value can I pick which will not exceed 100. So in this case I can pick maximum {50,40} which is less than 100. I tried to solve this using recursion, but i failed to do so because i can't establish any relation. How can I do so? Please help... I am new to recursion related topic.. TIA...