NB. Interesting, I must have not transcribed the rules.
NB. You knew this long ago.
sub_string_count_dwl=: (mp|.)@:>:@:#
sub_string_count_rh=: {:@:(+/\)@:>:@:i.@:#
sub_string_count_rh 'abcd'
10
sub_string_count_dwl 'abcd'
25
#@:;: 'a b c d ab bc cd abc bcd abcd'
10
Reference:
Date: Thu, 10 Jan 2013 11:10:14 -0800
From: Roger Hui <[email protected]>
To: Programming forum <[email protected]>
Subject: Re: [Jprogramming] Contests & Hackatons
Message-ID:
<CAMZ_i_AKUL
[email protected]>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm