abdalimran's blog

By abdalimran, 9 years ago, In English

You are given S,X and N.

S = size of an array

N = number of elements you have to find

X = sum

You have to find N elements from the array which sum is X.

Input:

7 25 3

1 5 10 7 13 15

Output:

5 7 13

If there are multiple solution you can output any of them. What are the best possible solutions with least complexity for this problem?

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By abdalimran, 9 years ago, In English

Hello, I am trying to learn recursion & DP techniques. As I am very beginner in these concepts, please help me by giving some links/tutorials/videos or any resources from which I can learn these concepts from scratch to advanced level.

Thanks in advance.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it