If you use a bit of dp then complexity can come down( not always)
 
Just note the fact that all numbers generated out of the subset will not be unique.
so using DP the max complexity is 
 
n*(max(n))
 
n -> number of input values ( size of s)
max(n) -> maximum number in the set of s
 
regards
Arunachalam.

 
On 12/22/05, adak <[EMAIL PROTECTED]> wrote:

Thanks, Mattia. Good post!

adak




--
===================================
want to know more about me
http"//ww.livejournal.com/users/arunachalam

Reply via email to