Solving for a set of numbers that add up to a given number

Posted Saturday, January 24, 2009 at 04h28 in Personal

A friend asked me this question earlier today, which can be described as follows. Given any set of numbers, find a way to identify all subsets within that set that add up to a given number. Simple enough, right? My solution– featuring simple recursive functions and AJAX (ya, I know, it’s no longer hip)– can be found here. The code can be found on my wiki, which I just re-discovered today.

1 Comment »

Comment from Ted on January 30, 2009 at 10:28 pm

dude… you da man!

RSS feed for comments on this post | TrackBack URI

Leave a comment

XHTML: You can use these tags:

<a href="" title="">
<abbr title="">
<acronym title="">
<b>
<blockquote cite="">
<cite>
<code>
<del datetime="">
<em>
<i>
<q cite="">
<strike>
<strong>