This challenge http://challenge.greplin.com seems to have missed the
forum. Each is straightforward in J.
The last is to count the subsets of an array where the largest number
is the sum of the remaining numbers. The given array is
B=: 3 4 9 14 15 19 28 37 47 50 54 56 59 61 70 73 78 81 92 95 97 99
A brute force calculation is:
<: +/ B ((+/=2*{:) @: #~)"1 #:i.2^#B
179
This takes a few seconds. Is there a better way?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm