[Jprogramming] k programming challenge

chris burke cburke at jsoftware.com
Tue Jan 26 23:16:52 UTC 2016


OK, here is a quick hack:

   b=: tolower fread '~temp/c.txt'
   c=: ;: ' ' (I.b e.'"()[]/;:.,-0123456789',LF)} b
   d=: (\:n){(~.c) (,' ',":@]) each n=. #/.~ c
   (;d,each '|') fwrite 'solution.txt'
11608

   fread 'solution.txt';0 80
the 727|of 495|shall 306|and 264|to 202|be 179|or 160|in 147|states
129|presiden
   +/'states' E. b
129

On 26 January 2016 at 14:29, Roger Hui <rogerhui.canada at gmail.com> wrote:

>
> http://kxcommunity.com/kx-student-programming-challenge-us-constitution-word-count.php
>
> J solution, anyone?
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm


More information about the Programming mailing list