I think you should change your description to

"I am trying to find out which integers in y contain no other digits than x"

I am also going to imagine that Thomas Bulka's proposed result is correct here.

Experimenting with this, one of the issues is efficiency and 0 as a
digit. Since 0 is used for padding, if 0 is not an element of x, we're
going to have to break the integers in y into digits independently to
avoid problems with padding. And, I guess 10&#.inv&.> is one way of
accomplishing that.

The other thing is how do we detect extra digits. The first approach
which occurs to me would be to use -.L:0~

In other words, this is almost a useful result:

   1 3 5(-.L:0~ 10&#.inv&.>)  5311 10531 536 1111111
++-+-++
||0|6||
++-+-++

To make it useful we could add a test for 0 being the shape of each of
those vectors. For example;

   0= #@> 1 3 5(-.L:0~ 10&#.inv&.>)  5311 10531 536 1111111
1 0 0 1

There's more that could be done here. For example, the first thing I
wanted to do was turn both x and y into bit lists (one bit for each
digit in a representation of x and in the last dimension of a
representation of y), But, I imagine that this is useful enough, and
should be enough to get you started.

FYI,

-- 
Raul

On Sat, Aug 26, 2023 at 6:31 AM Richard Donovan <rsdono...@hotmail.com> wrote:
>
> I am trying to find out whether a series of integers y only contain a set of 
> integers x
>
> That is,        1 3 5 verb 5311 10531 536 1111111
>  should return 1 0 1 1
>
>    NB. only 1 3 5 occur in 5311
>    NB. not only 1 3 5  occur in 10531
>    NB. not only 1 3 5  occur in 536
>    NB. only 1 3 5 occur in 1111111
>
>  NB. x only contains digits 0-9 without repeat. #x is max 10
>  NB. leading zeros should be ignored in elements of y. No max for #y
>
> I have tried several methods using combinations of e. i. under< etc. but 
> haven't yet found a succinct verb that achieves what I want.
>
> I hope my description is clear
>
> Help gratefully received!
> ----------------------------------------------------------------------
> 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