If that's an actual issue, it's possible to solve, but note that there
are several possible variations of that kind of issue (consider what
might happen if duplicate values in the three wide table were
significant information in this context), so we would need a good
description (with good disambiguating examples) to make sure we were
solving the right problem.

But it would be just as bad to omit recognizing something like abcabc
if it was important that that be recognized.

Thanks,

-- 
Raul


On Fri, Apr 8, 2022 at 2:20 PM Elijah Stone <elro...@elronnd.net> wrote:
>
> Note this doesn't work if duplicates are 'consumed'; depends on the exact
> problem constraints is an issue ('any two' is somewhat ambiguous).  E.G.
> if r contains a row 'abcabc', this routine will consider that row a match
> even if l only contains one 'abc' row.
>
> On Fri, 8 Apr 2022, Henry Rich wrote:
>
> >    l =. 'abc','def',:'ghi'
> >    l
> > abc
> > def
> > ghi
> >    r =. 'abceee','defabc','mmmxxx','abcdef',:'ghidef'
> >    r
> > abceee
> > defabc
> > mmmxxx
> > abcdef
> > ghidef
> >
> >    l (] #~ [: *./"1  (e.~   2 3&$"1)) r
> > defabc
> > abcdef
> > ghidef
> >
> > Henry Rich
> >
> >
> > On 4/8/2022 10:21 AM, Richard Donovan wrote:
> >> Hi J programmers
> >>
> >> I need help to discover the most efficient way of doing the following :-
> >>
> >> I have two tables, on of n three-character items, and a second of m
> > six-character items such as…
> >>
> >> abc,def,ghi
> >>
> >> abceee,defabc,mmmxxx,abcdef,ghidef
> >>
> >> I need to know which six-character items can be composed of any two
> > concatenated three-character items, so in the above example the required
> > output would be
> >>
> >> defabc,abcdef,ghidef
> >>
> >> There may be many thousands of entries in each tables, so an efficient
> > algorithm is required!
> >>
> >> Thanks in advance
> >>
> >> Richard Donovan
> >>
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >
> > --
> > This email has been checked for viruses by AVG.
> > https://www.avg.com
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to