Countdown: Difference between revisions

m
→‎{{header|J}}: discard duplicate solutions
(J draft)
m (→‎{{header|J}}: discard duplicate solutions)
Line 44:
expr=: {{ (Pa A),(;u`''),Pa B['A B'=.y }}
arith=: [:; <@(+Va, -Va, *Va, %Va,(-Va, %Va)@|.)"1
all=: {{ A#~x=".@>A=.~.,arith^:5 ":each y}}
 
task=: {{
Line 55:
Examples:
<syntaxhighlight lang=J> task''
terms: 12 13 53 106 109 7550
target: 736476
#solutions: 364477
for example: (109*(75-13+50))-(106-(12+53))
task''
terms: 1 2 4 46 7 108 9
target: 567657
#solutions: 3775
for example: 79*((28+(10*(41+4)*(6+7))-1)</syntaxhighlight>
task''
terms: 4 7 8 9 10 10
target: 300
#solutions: 495
for example: (10+(9*10))*((4+7)-8)</syntaxhighlight>
 
=={{header|Phix}}==
6,962

edits