Just in case it matters,  are you regarding Hello & Jello as distinct words here,  or is
space just another character?

If they're separate,  then we need only examine (;: s) or (cut s), brackets only to delimit
the J idioms.

Thanks,

Mike

On 09/04/2021 14:48, Emir U wrote:
s=: 'Hello Jello'

Given a string like the above, I need to tabulate the number of occurrences of 
every letter for every prefix of length >=k. I also need to know the length of 
the prefix. So:

<prefix length> <prefix> <letter> <count>

As an example, prefix length=3, prefix=ell, letter=o, count=2

In my real use case k may be quite large (say 20) and the string may be very 
long. The final form needs to be something I can slice and dice thereafter 
(like perhaps a sparse array). I'd be grateful for any advice as to how to 
tackle this.

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


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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

Reply via email to