not too efficient but something to start with one =: 3 3 $ 'abcdefghi' other =: 5 6 $ 'abceeedefabcabcdefghidef' find =: #~ one *./"1@:e.~ , $~ 2 3 ,~ */@:$ % 6: find other defabc abcdef ghidef
Am 08.04.22 um 16:21 schrieb Richard Donovan:
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
-- ---------------------- mail written using NEO neo-layout.org ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm