brute forcing. I considered using math/misc/amoeba, but wasn't sure if
it'd be a fit

odometer=:#: i.@(*/)
options=:(#~ (<&101)@:(+/"1)) odometer 101 101 101 101
arr=:;"1 (2,4,6,8,10) {"1 (<@(". :: (_"1))@((}:)^:(','={:)) );._1@('
'&,) every cutLF input

parts=: (((0"_)^:(0>])"0) @: (+/)@:(arr * ]))"1 options
getScore=: [: >./ ([: */ }:)"1
smoutput pt1 =: getScore parts
smoutput pt2 =: getScore@:(#~ (500 = 4&{"1)) parts
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to