Interview Question

Software Engineer Interview(Student Candidate)

Given an array of distinct integers, and a target integer

  t, compute all of the subsets of the array that sum to t, where order matters. (I was given ~20 minutes to solve this)

Interview Answer

1 Answer


Simple - use divide et impera to create the list for number N as (1, Listfor(N-1)), (2, listfor(N-2)) ... etc

Alex on Feb 7, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.