On Thu, Aug 18, 2011 at 9:24 AM, Ric Sherlock <[email protected]> wrote: > A=: 'CTGGTTGAT','GTAGTCATA','CATGTCTAA','TCGAAAGTT',:'CCGGAGAAG' > > and the list 'TAG' > > Identify the rows of the matrix where the letters in the list occur in > the order they appear in the list, but not necessarily adjacent to > each other. > So the result of a verb findinRows would be: > A findinRows 'TAG' > 0 1 0 1 0
findinRows=: [: *@#@> [: ((> # [) <./)&.>/"1 <@I.@(=/"1~ |.) Time and space requirements of this implementation are proportional to *&#&, Theoretical requirements are proportional to *&#@[ So for long y a different approach should be better. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
