Talk:Longest string challenge: Difference between revisions

m
Line 97:
::::::: But, ok, you probably do not know enough J to read that sentence, so here's a description: Using the end of line marker, form the characters into a two dimensional array (padding short lines with spaces). This is the left argument to the inner expression. The right argument is formed using the same technique, except that we reverse each line in the process of forming them into an array and then reverse each row again after it has been padded. The inner set of parenthesis contains an expression which will keep the rows which are identical in both copies.
::::::: That said, it's probably also worth noting that most J programming involves "thinking outside the box" if "the box" means "traditional approaches used in traditional languages".
::::::: Also, for reference, here is a "use length directly" approach: <code>(#~ (=>./)@:(#@>))@(<;._2)@(1!:1)</code> --and note that it does not use any "comparison operators" except = and that it's not doing any "arithmetic". It is, however, finding the maximum length and using that to select the relevant rows.
::::::: --[[User:Rdm|Rdm]] 01:08, 15 August 2011 (UTC)
 
6,962

edits