[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ProgSoc] Combination Theory



Hey Kiddies, 

I'm sick of all the shit going on here regarding the differences b/w 
OS's ... so I thought I'd post a _REAL_ programming question. 

Ok ... I'd like to write a function that is passed an integer, and returns an 
array of strings (?), containing all possible unique combinations of the 
numbers up to and including the argument. 

E.G. If I pass a 4, I get the following: 

[], 
[1], [2], [3], [4] 
[1,2], [1,3], [1,4], [2,3], [2,4], [3,4] 
[1,2,3], [1,2,4], [1,3,4], [2,3,4] 
[1,2,3,4] 

Oh .. efficiency is an issue ... but don't let that stop you from posting an 
attempt. 

Any ideas? 


--
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.

This list is archived at <http://www.progsoc.uts.edu.au/lists/progsoc/>