The one liner below seems to work, but time- and
space-wise it is slightly inferior to RE Boss's cAO. Though,
in my opinion, it is more direct.

NB. word wrap problem

C =: 4 : '(,~x)$(/:@;@( [: </. i.)@,~x){;<@(%&(1+x-~#y))@((1+x-~#y)+/\])/.(*"0 
1 |.) y'

   ts '276 cAO i.600'
0.226437 1.16933e7
   ts '276 C i.600'
0.378538 1.198e7

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to