Subset Sum Scoreboard
Rank Username Score
1 primo 1000 (101 B)
2 vird 802 (126 B)
3 Steinigtmich 795 (127 B)
4 eremit 721 (140 B)
5 Ock 706 (143 B)
6 jt2k 706 (143 B)
7 scottholdren 678 (149 B)
8 henrik 678 (149 B)
9 linepogl 643 (157 B)
10 Anyone 601 (168 B)
11 svendra 577 (175 B)
12 kcmastrpc 453 (223 B)
13 nishanth 432 (234 B)
14 ricodimas 311 (325 B)
15 anneliesez 70 (1441 B)
Recent Activity
Username Bytes Time ago Result
kcmastrpc 223 December 06 2013, 01:15:59
kcmastrpc 223 December 06 2013, 01:08:15
kcmastrpc 204 December 06 2013, 00:34:47
kcmastrpc 234 December 05 2013, 02:50:07
kcmastrpc 234 December 05 2013, 02:48:51
kcmastrpc 236 December 05 2013, 02:00:25
kcmastrpc 201 December 05 2013, 01:17:53
kcmastrpc 199 December 05 2013, 01:14:06
kcmastrpc 202 December 05 2013, 01:12:31
kcmastrpc 214 December 05 2013, 01:10:10
Anyone 168 December 04 2013, 22:10:52
Anyone 167 December 04 2013, 22:09:57
Anyone 169 December 04 2013, 22:06:32
Anyone 170 December 04 2013, 21:58:13
Anyone 170 December 04 2013, 21:55:47

Challenge: Subset Sum

Challenge information

Challenge Type Private
Challenge Status Open
Constant name LISTS
Trim method Full trim
Disabled functions shuffle str_shuffle
Rating [ up ] [ down ]

Instructions

The input is 20 lists of numbers separated with a newline.

Each list will contain numbers from -20 to 20 without 0.

Each number in the list will be separated with a comma.

Find out if any combination of the numbers in the list will add up to 0.

Print out "yes" or "no" for each list.

The output for the list 10,-20,10,5,-9 should be "yes" because 10 + 10 + (-20) equals 0.

Read more here: http://en.wikipedia.org/wiki/Subset_sum_problem

Example

Show/hide Input
10,-20,10,5,-9
18,-19,-2,-9,9
7,-9,-4,-5,-6
6,6,-19,-2,-12
-17,8,-3,-8,13
-9,-14,-8,-11,-6
-13,-7,3,-16,-3
1,17,-11,7,-1
-11,-12,14,19,-15
10,8,-9,-17,8
-4,5,5,-14,-15
-9,-9,-16,-3,13
17,-4,-4,20,-16
-1,-16,2,4,19
12,4,11,5,10
-7,-14,-13,5,-15
-3,4,-18,12,-2
-20,9,8,-11,-8
-18,8,-12,-18,-19
-15,-2,-12,-17,13
Show/hide Output
yes
yes
no
yes
yes
no
yes
yes
no
yes
no
no
yes
no
no
no
no
yes
no
no

Comments

Show/hide comments (0)