text:
Does a letter fit inside the other?
Do you remember my mat properly grouped by colors?

Yesterday I was looking at it and realized that some letters fit inside others. Example: a letter P fits in the place where the letter R goes. So here's a simple challenge: given two letters, return a truthy value if any one of the letters fits inside the other (directly or rotated, but not flipped), or a falsey value if they don't. That is, if the input is [P,R] or [R,P], you must return truthy because in both cases one letter fits inside the other. If you get [L,U] you must return falsey as neither fit inside the other.
Rules

The input must be two alphanumeric characters in the range [0-9A-Z], as there are also numbers in the mat, in any form you need (two separate chars as two inputs, a list with two chars, a string with the 2 chars, whatever).
The output must be consistent (the truthy and falsey values must be always the same).
Following is the table of fittings (note that a letter always fits in its proper place, just in case you get something like [Y,Y] as input):
char fits inside chars
--------------------------------------------------------
   C             G,O
   F             B,E,P,R
   G             O
   I             0,1,7,B,D,E,F,H,K,L,M,N,O,P,R,T,V,W,X,Z
   L             E
   M             W
   P             R
   S             O
   V             A
   W             M
   0             O
   1             B,E,L
   3             O
   6             9,O
   8             O
   9             6,O

I solemnly swear that I have tested every fitting in my kid's mat. (Dries his sweat from his forehead.)
This is code-golf, so may the shortest code for each language win!
Some test cases
input  output
-------------
[C,G]  truthy (C fits inside G)
[G,C]  truthy (C fits inside G)
[F,R]  truthy (F fits inside R)
[M,W]  truthy (both fit inside the other)
[O,S]  truthy (S fits inside O)
[T,T]  truthy (T fits in its place)
[E,V]  falsey (no fit found)
[P,L]  falsey

Sandbox post. Please, forgive me if you spot more fittings that I missed. Many thanks to Οurous for helping me with the fittings list.

[tag:kolmogorov-complexity].

1 doesn't fit in F?

@user202729 no, because you need to flip the 1 to fit it in the F but that's not allowed in my mat. :-)

Ah, it's rotation.

Illustration ASCII-art graph (of course fit-in is transitive)

@Rod yes, and the result would be truthy as a letter always fits in its proper place. I have edited the question.

i think we'd all really appreciate test cases :p

@BrianH. sorry for that, I added some test cases. Feel free to ask for more.

Do C and O not fit inside Q in your font?

@Zgarb probably. I completely forgot about the Q, but I cannot change the challenge now.

@Charlie Only two answers so far, wouldn't be too much disruption?

@Οurous it was in this other question when it already had two answers... Besides, the challenge already has many cases to test, more cases won't add anything to it (I think the most creative part is that the two inputs are interchangeable as you have to check both fittings).

Why does I fit inside 0?

Python 2, 135 130 129 bytes
-1 byte thanks to Lynn
lambda s:cmp(*s)%2*s[::cmp(*s)|1]in'OIH TIE XI7 RF O8 OGC LI0 O3 O96 VA O6 KI PI WI L1 WMI O0 RIB NI1 FE SOC VID ZIFB1 PF LE1 RP'

Try it online!
Python 3, 143 bytes
lambda*i:any({*i}&{a,c}=={*i}for a,b in zip('CFGILMPSVW013689','GO BEPR O 017BDEFHKLMNOPRTVWXZ E W R O A M O BEL O 9O O 6O'.split())for c in b)

Try it online!

Retina, 93 92 bytes
O`.
(.)\1|1[BEL]|69|AV|CG|BF|EF|EL|FP|FR|[017BDEFH]I|I[KLMNOPRTVWXZ]|MW|PR|OS|[03689CG]O

^$

Try it online! Edit: Saved 1 byte thanks to @ovs.

Does this work for 92 bytes?

Haskell, 149 145 bytes
[]!_=0>1
(a:b:c)!t=(a,b)==t||(b,a)==t||c!t
f x y=x==y||"0I0O1B1E1I1L3O696O7I8O9OAVBFBICGCODIEFEIELFIFPFRGOHIIKILIMINIOIPIRITIVIWIXIZMWOSPR"!(x,y)

Try it online!

Javascript 155 153 151 149 bytes
I think this works on all cases, 1/0 for true/false.
(c,f,q=1)=>"CGO,FBEPR,GO,I017BDEFHKLMNOPRTVWXZ,LE,MW,PR,SO,VA,WM,0O,1BEL,3O,69O,8O,96O".split`,`.some((v=>v[0]==c&v.includes(f)))|c==f|(q?F(f,c,0):0)

Explanation:
F=(
c, // input 1
f, // input 2
q=1 // variable used to execute F twice
)=>(
"CGO,FBEPR,GO,I017BDEFHKLMNOPRTVWXZ,LE,MW,PR,SO,VA,WM,0O,1BEL,3O,69O,8O,96O".split`,`
                              // array of strings where [0] is input 1 and [>0] are the fittings
.some(                        // any element of the array meets:
(v=>v[0]==c&v.includes(f)))|  // input 1 equals [0] and input 2  exists in the lookup string OR
c==f|                         // input 1 equals input 2 OR
(q?F(f,c,0):0)                // input 2 fits inside input 1

let F=(c,f,q=1)=>"CGO,FBEPR,GO,I017BDEFHKLMNOPRTVWXZ,LE,MW,PR,SO,VA,WM,0O,1BEL,3O,69O,8O,96O".split`,`.some((v=>v[0]==c&v.includes(f)))|c==f|(q?F(f,c,0):0);
let tests = [
  ["C","G"],  //truthy (C fits inside G)
  ["G","C"],  //truthy (C fits inside G)
  ["F","R"],  //truthy (F fits inside R)
  ["M","W"],  //truthy (both fit inside the other)
  ["O","S"],  //truthy (S fits inside O)
  ["T","T"],  //truthy (T fits in its place)
  ["E","V"],  //falsey (no fit found)
  ["P","L"]   //falsey
];
tests.forEach((v)=>{console.log("F('"+v[0]+"','"+v[1]+"') = " + F(v[0],v[1]))});

Changelog:

saved 2 bytes thanks to kamoroso94
saved 2 bytes thanks to Chris M
saved 2 bytes by changing lookup method to .some()

Does this return true if c fits f or f fits c? It seems that you only check one case.

Code fixed to return true if f fits c

I'm not too good explaining, if anybody wants to make it clearer feel free to suggest an edit

You can use includes(f) instead of indexOf(f)>=0 to save 2 bytes.

awesome, didn't even know that was a thing :D

You can save another two by using split, instead of split(",")

Clean, 276 226 bytes
Vaguely golfed-ish. Will polish tomorrow.
import StdEnv
i a b=isMember b a
t=True
f'C'b=i['GO']b
f'F'b=i['BEPR']b
f'O'b=i['GS03689']b
f'I'b=i['017BDEFHKLMNOPRTVWXZ']b
f'L''E'=t
f'P''R'=t
f'V''A'=t
f'M''W'=t
f'1'b=i['BEL']b
f'6''9'=t
f _ _=False
?a b=a==b||f a b||f b a

Try it online!

Kotlin, 147 139 bytes
fun p(s:String)=setOf(s,s.reversed()).any{it.matches(Regex("(.)\\1|F[BEPR]|I[017BDEFHKLMNOPRTVWXZ]|1[BEL]|69|CG|LE|MW|PR|VA|O[CG69038S]"))}

Try it online!
The example on Try It Online includes test cases for every positive combination and a few negative ones.
I haven't optimized the reg.ex. too much, so it might be longer than necessary
EDIT: saved a few bytes on reg.ex.

Julia 0.6, 139 bytes
(a,b)->(a==b)|any(map(x->all(in.((a,b),x))|all(in.((b,a),x)),zip("OCFILMPV16",split("CGS0368 G BEPR 017BDEFHKLMNOPRTVWXZ E W R A BEL 9"))))

Try it online!
Saved some bytes by grouping the chars that fit into 'O'. But testing the reversed input uses too much code...
Explanation:

zip(☐) zips corresponding single letters from "OCFILMPV16" & a string of matching letters.
.in(☐) is applied elementwise, e.g. (in(a,'O'),in(b,"OCFILMPV16"))
all(.in(☐)) Both must be found...
| for either a,b or b,a...
any(map(☐)) for at least one element of the zipped list.

C (gcc), 211 bytes
A first attempt. Very straight-forward.
i;char*c="CFGILMPSVW013689",*x[]={"GO","BEPR","O","017BDEFHKLMNOPRTVWXZ","E","W","R","O","A","M","O","BEL","O","9O","O","6O"};h(a,b){return(i=strchr(c,a)-c)>=0&&strchr(x[i],b);}f(a,b){return a==b|h(a,b)|h(b,a);}

Try it online!

PHP, 204 bytes
-147 bytes because I cam back to remove 2 bytes only to find that my code had a few bugs and unused variables! My code is now much shorter.
<?php $a=fgets(STDIN);for($w=0;$w<2;$w++){if(strpos(explode(',','GO,BEPR,O,017BDEFHKLMNOPRTVWXZ,E,W,R,O,A,M,O,BEL,O,9O,O,6O')[strpos(CFGILMPSVW013689,$a[0])],$a[1])!==false){echo"t";break;}$a=strrev($a);}

Try it online!

Ruby, 140 bytes
->c,t{x='CFGILMPSVW013689'.chars.zip('GO BEPR O 017BDEFHKLMNOPRTVWXZ E W R O A M O BEL O 9O O 6O'.split).to_h;p x.key?(c)&&x[c].include?(t)}

Pretty much the same as the python 3 answer, but with a different execution.


text:
Find the longest word in an array
Your challenge is to take an array of strings and output the longest string in the array. So for
["tiny", "small", "bigger", "biggest"]

the output would be biggest.
If two elements of the array have the same length, you should choose the one that appears first in the array. That means if the array looks like this:
["one", "two", "no"]

the output is one, but if the array looked like this:
["two", "one", "no"]

the output is two.

As this is code-golf, the shortest code in bytes wins.

2 notes: 1 It's heavily discouraged if the question is changed and invalidates existing answer, and 2 the Sandbox exists for exactly that reason (make sure challenges are good before posting)

Since I don't think anyone else has mentioned it -- Hi, and welcome to PPCG!

Do you have any other test cases? Should we handle the case where the array is empty and, if so, how?

No you don't have to handle the case where the array is empty. But if you want you can.

2 hours? That's far, far too quick to be accepting an answer.

@Shaggy I un accepted the answer i will look into it tomorrow.

Normally you wait a week

-1 because this is a fairly trivial challenge.

Imperative Tampio, 168 bytes
Listan x on riippuen siitä,onko sen ensimmäisen alkion pituus suurempi tai yhtä suuri kuin sen jokaisen alkion pituus,joko sen ensimmäinen alkio tai sen hännän x.

Online version
Ungolfed:

Listan pisin alkio on riippuen siitä, onko sen ensimmäisen alkion pituus suurempi tai yhtä suuri kuin sen jokaisen alkion pituus, joko

sen ensimmäinen alkio tai
sen hännän pisin alkio.

Online version
The only golfing opportunity this has is to replace pisin alkio (meaning "the longest element") with x.
Translation:

The longest item in a list is, depending on whether the length of the first item is greater or equal to the length of each element in the list, either

the first item in the list, or
the longest item in the tail of the list.

Is this a-... Does thi-... How do you-.... What?!

Google Translate from Finnish: List of x is dependent on whether the length of the first element greater than or equal to the length of each element, either the first item or the tail of x.

@Adám I used to think APL is hard to read. Apparently all you need to beat that is to move the gamefield to a language where English is a rare commodity.

Who needs COBOL, AppleScript or Inform 7? Who needs Arnold Chef or Shakespeare? You have Imperative Tampio! Oh my flying spaghetti monster, Finnish of all languages? I'm not learning that one any time soon...

BTW, all my Finnish amounts to "suomi", "moi" and "suudelma". Can I program something with that? :P

@fedes. You could say "Olkoon suomalainen suudelma uusi suudelma." (Let the Finnish kiss be a new kiss, it creates a new kiss object)

So this is basically a Finnish AppleScript.

Simply the best way to hanlde this. I know this isn't the shortest answer but this answer is awesome!

Python, 23 bytes
lambda a:max(a,key=len)

Try it online!

I'm sorry that I didn't convert this right.

I updated the code snippet, but as it is written, it already achieves this functionality.

This will also work unchanged in Python 3.

Haskell, 35 bytes
-3 bytes thanks to Zgarb.
foldl1(!)
a!b|(a<$a)<(a<$b)=b|1<2=a

Try it online!
I like this code. You know why? Because Haskell supports much more elegant solutions with functions from random libraries.
maximumBy(compare`on`length).reverse

That's friggin' readable! Except, it's not valid.
import Data.List
import Data.Function
maximumBy(compare`on`length).reverse

If it weren't for the imports, this would've been a perfect submission to get all the upvotes. :P
(Also, this uses one golfing tip and it uses a fold.)

With out the added "first-occurence-in-case-of-tie"-requirement, this beauty would work: snd.maximum.map((,)=<<(0<$)) Try it online!.

How do you manage to write elegant code even when golfing? o0

Just for reference: there's the boring 29 byte built-in import Data.Lists;argmax(0<$).

Woah, how is the l not a part of fold? How does it distinguish between that and a function named foldl?

@12Me21 It is part of the function name foldl1. I thought that part of the explanation might be confusing, sorry...

35 bytes with a function instead of lambda. Interestingly, you must replace 0 with a or something else, otherwise GHC complains about an ambiguous numeric type.

"If it weren't for the imports, this would've been a perfect submission to get all the upvotes" --- I'm convinced that we need a Haskell Prelude reimplementation that's optimized for golfing.  There are too many critical functions and/or operators that aren't in the default Prelude, and import is way too wordy to be usable.

R + pryr, 31 bytes
[-2 bytes thanks to Scrooble]
pryr::f(x[order(-nchar(x))][1])

Try it online!

R, 33 bytes
function(x)x[order(-nchar(x))][1]

Try it online!

Also 33 bytes: x[which.max(nchar(x))]

@Scrooble  from your link I see a 33 bytes solution.

@NofP Haha, silly me. 31 bytes.

EXCEL, 36 42 bytes
=INDEX(A:A,MATCH(MAX(LEN(A:A)),LEN(A:A),))

Entered as an array formula (ctrl-shift-enter). The input array should be entered in column A.
The formula returns the first match with maximum length.
Depending on your region settings, substitute , with ;; the code length remains unchanged.
Of the 16 languages listed here, English function names are the shortest for this formula.
Explanation:
=                                          - return
 INDEX(                                  ) - the item of
       A:A                                 - the input
          ,                                - at
           MATCH(                       )  - the position of
                                       ,   - the first exact match of
                 MAX(        )             - the maximum of
                     LEN(   )              - the array of lengths of
                         A:A               - the input
                              ,            - in
                               LEN(   )    - the array of lengths of
                                   A:A     - the input

What for the , in the latter? The formula still works without it

The final , is a parameter for MATCH that returns the first exact match, as required by the (revised) question. If it is left out, then MATCH expects an array in ascending order, and returns the last match instead of the first if there are multiple elements with the same length.

Are sure? I've compared those two formulas and both come with the exact same result

Are you using an input array that has two (different) strings of the same length? Leaving out the comma (semicolon) gives me the last string of maximum length, as expected... (Excel 2016, 64-bit)

Unfortunately the community has decided that using named ranges in this manner is invalid so I suggest that for this particular case you switch to using A:A and make it an array formal with {...}, otherwise great post!

@TaylorScott thanks for the heads up. I'll modify the answer.

Prolog (SWI), 98 92 72 69 bytes
The top level predicate is *.
X/Y:-atom_length(X,Y).
[A]*A.
[A,B|L]*Z:-A/X,B/Y,Y>X,[B|L]*Z;[A|L]*Z.

Try it online!
Explanation
The first row defines the dyadic predicate / to be a short for atom_length/2which is true if the first argument's length is the second argument. This saves us 3 bytes over using atom_length twice.
Our main predicate is defined as the dyadic * where the first argument is a list and the second argument the longest element of that list.
The second row is our base case which states that the longest element of a one element list is that element.
The third row states that for a list with at least 2 elements, the longest element is:
If the length of the second element is longer than the first element, the longest element is in the list without the first element.
Otherwise the longest element is in the list without the second element.

I'd be interested in seeing an explanation on how it works

@Cowsquack: I've added a short explanation.

APL (Dyalog Unicode), 9 bytesSBCS
⊢⊃⍨∘⊃∘⍒≢¨

Try it online!
⊢ from the argument,
⊃⍨ pick the element with the index which is the
⊃ first of the
⍒ indices in descending order of the
≢¨ lengths of each

Pyth, 4 bytes
h.Ml

Test suite.
Explanation
h.Ml   | Program
h.MlZQ | With implicit variables filled in
-------+--------------------------------------------------------------------
h      | First element of
 .M  Q | The list of elements from the input list with the maximal value for
   lZ  | The length of the element

ou nice you beat the Pyth answer with 6 bytes nice.

elD_ and ho_l achieve the same length.

@hakr14 Thank you very much for the edit!

Octave, 33 bytes
@(x)x{[~,p]=max(cellfun(@nnz,x))}

Input is a cell array of strings.
Try it online!
Explanation
cellfun(@nnz,x) applies the nnz function (number of nonzeros) to each string in the input array x. For ASCII strings, nnz is equivalent to numel (number of elements), but shorter. The result is a numeric array with the string lengths.
Then, [~,]=max(...) gives the index of the first maximum in the array of string lengths. The result is used as a curly-brace index into x to obtain the corresponding string.

JavaScript (Node.js), 38 bytes
Try it online!
a=>a.sort((a,b)=>a.length<b.length)[0]

@Doggo It does return the first element in the case of a tie.

Returning a boolean instead of a signed number in the sort() callback doesn't work in all JS engines (e.g. it doesn't work in Edge). Another approach would be something like that, which is 1 byte shorter. Still, there's no guarantee that the first item will be chosen consistently across browsers in case of a tie.

but if it chooses it consistently in node.js on TIO isn't that good enough?\

Yes it is because we define languages by their implementation. But then it would be better to specify the JS version it is supposed to be run on in the title of your answer.

You should be using - instead of < in the comparator function.

@kamoroso94 I tried that in the TIO and it didn't work.

Use b.length-a.length instead.

@Xufox but the current solution works and  a - doesn't save any bytes?

@LiefdeWen Yes, but it addresses the problems in the comments.

PowerShell, 24 bytes
($args[0]|sort l* -d)[0]

Try it online!
Takes input $args[0], pipes that to Sort-Object based on length in -descending order. Then takes the [0]th one thereof. Since sort is stable, this takes the first element in case of a tie.

Nice name wuff wuff :D

J, 19, 11, 10 8 bytes
0{>\:#@>

Try it online!
Thanks to streetster for the hint!
-1 byte thanks to FrownyFrog!
-2 bytes thanks to Conor O'Brien
How it works:
    (  #@>) - unbox each string and find its length
     \:     - sort down the list of strings according to the lengths
0{::        - take and unbox the first string

Try it online!

This was my initial approach in K, but then I realised I could just sort the list by the count, descending, and take the first item... Can you do the same thing in J?

@streetster - Thanks! I just realised that. I'm going to try it now, it sould be much shorter.

No parentheses beyond this point: 0{::]\:#@>

Would {.@ instead of 0{:: work?

@ FrownyFrog Cool, a fork instead of a hook to get rid of ()

@Cows quack I don't  think it will unbox the string. Can you post the entire verb?

Ah, I didn't notice that it returned a boxed string. Never mind then.

8 bytes: 0{>\:#@>

@Conor O'Brien Thanks! ] was just a filler, so > is the right verb.

Perl 6,  14  13 bytes
*.max(*.chars)

Try it
*.max(&chars)

Try it

PHP, 72 bytes
array_reduce($a,function($c,$i){return (strlen($i)>strlen($c))?$i:$c;});

Hello, and welcome to PPCG! :)

C#, 43 + 18 = 61 bytes
Try it online!
a=>a.OrderByDescending(x=>x.Length).First()

@Doggo It does return the first element in the case of a tie.

@LiefdeWen OrderBy is stable so this will in fact return last element in case of a tie. Example: https://tio.run/##TY7BCsIwDIbvfYqwUwvaF5jbQcHTRMGDB/FQatSCNth0biJ79lkrgv/pzxf4EstTSwHHlp0/w/bJEW@l@J904/y9FMJeDTNsxEtACkcTnYUHuSOsjPNSZfxdfrJsvZ1xDEm0P0zg22o4JQwVjKaqjV6HI4b5U/ZV3esG/TlelG4MR6nGdPGnWpBnuqLeBRcxfYPyY5Eeu/0BXlCQx2ICReyIKJdLwExO1IaQi3tgAYNSZZYOYhDjGw

@GrzegorzPuławski Oh, I see, fixed.

I've got a few that maybe someone can help shorten a=>a.Aggregate((x,y)=>y.Length>x.Length?y:x) 44 byte base, a=>a.First(x=>x.Length==a.Max(y=>y.Length)) 43 byte base

'Descending' is so long you can save a byte by reversing the collection first a=>a.Reverse().OrderBy(x=>x.Length).Last() 42+18

@MrLore That was my first solution but then in a tie it returns the last one, because order is unaffected.

34 bytes - https://tio.run/##TY7NqgIxDEb3fYowqxa0LzB3ZqHgSlFw4UJclBq1MDaYdPxB5tnn1sqF@62@nMBJvEw9MY69hHiG7UsSXmv1f7LLEG@1Ur5zIrBRbwU5klwKHu4UjrByIWpT8Hf5yaKP/kcSZ9H@MIFva@GUMTQwuqZ1ds1H5NlLP5t2@rRLjOd0MXYRWJI2Y775J5tTFOrQ7jgkzP@g/nh0xMf@AG@oKGI1gSo9iKiUC2MhJ@qZSwl3rGAwpi7SQQ1q/AU

Japt -h, 5 3 bytes
ÔñÊ

Try it
Reverse, sort by length and output the last element.

Bash, 45 bytes
a=;for b;do((${#b}>${#a}))&&a=$b;done;echo $a

Try it online!

Welcome to PPCG, nice first post!

Scratch 27 17 170 160

It expects a global (attached to all sprites, to be more precise) list of strings called mylist. After clicking the green flag, the longest word will be left in the variable w.
I think this is the link
when gf clicked
set[w]to(item[1]of[mylist
set[i]to[0
repeat(length of[mylist
change[i]by(1
set[m]to(item(i)of[mylist
if<(m)>(w)>then
set[w]to(m
end
end
stop[all

Counting as per this meta.

Is it necessary to stop[all here?

Java (OpenJDK 8), 67 bytes
Another submission in my favourite language! (read: the only one I know).
This doesn't work with an empty array, but that's fine.
Golfed
w->{for(String y:w)if(y.length()>w[0].length())w[0]=y;return w[0];}

Ungolfed
for(String y:w)                           // Loops through all Strings
    if(y.length()>w[0].length())          // If the String is longer than the first String
                                w[0]=y;   // Store it as the first string.
return w[0];                              // Return the first String.

Try it online!

Racket, 160 bytes 110 bytes
Try it online!
First time contributing, advice appreciated!
(define(m a)(if(>(length a)1)(if(>=(string-length(car a))(string-length(m(cdr a))))(car a)(m(cdr a)))(car a)))

Ungolfed
(define (m a)
    (if (> (length a) 1)
        (if (>= (string-length (car a)) (string-length (m (cdr a))))
            (car a)
            (m (cdr a))
        )
        (car a)
    )
)

Updated solution based on feedback

I'd like to say welcome to PPCG on behalf of the community! I noticed that your solution apparently fails for lists where the longest string is at the end. Example here. I don't remember Racket well, but if you can I would recommend changing your algorithm to a foldr-based approach, taking the max by length and carrying that across.

Oh huh. Thank you for pointing that out. I can't believe that I didn't test that.

You can also change the define(m a) to λ(a)

Also check the tips if you haven't!

APL -- 23 16 bytes

a←{((⍴¨⍵)⍳(⌈/(⍴¨⍵)))⌷⍵}

Thanks to everyone for all of your great suggestions and encouragement!
a←{⍵⌷⍨(⍴¨⍵)⍳⌈/⍴¨⍵}

Usage:
a 'duck' 'duck' 'goose'
  'goose'

Explanation:
gets length of each vector of characters (string) then uses maximum as an index. I just started APL 20 min ago so I am sorry if this is a stupid way to do it.
Try it Online!
(edited for clarity)

Welcome to PPCG!

The a← is not counted towards your bytecount.

Never forget APL is evaluated right-to-left: (⌈/(⍴¨⍵)) => ⌈/⍴¨⍵. Also, (...)⌷⍵ => ⍵⌷⍨... to save one byte

Other than the parentheses, this actually seems pretty good!

Swift, 54 bytes
{($0 as[String]).reduce(""){$1.count>$0.count ?$1:$0}}

Try it online!

K (oK), 9 bytes
*x@>#:'x:

Try it online!
Example:
*x@>#:'x:("edur";"oot";"taht")
"edur"

Explanation
*x@>#:'x: / solution
       x: / store input in variable x
    #:'   / count (#:) each (')
   >      / sort descending
 x@       / apply indices to x
*         / take the first one

Notes:
Undeleted as this is classed as non-trivial, despite being basically 5 steps (would be if written as the function {*x@>#:'x}).

Röda, 30 bytes
{enum|[[#_,-_,_1]]|max|_|tail}

Try it online!
Explanation:
{
 enum|         /* For each element, push its index to the stream */
 [[#_,-_,_1]]| /* For each element and index, push [length, -index, element] */
 max|          /* Find the greatest element */
 _|            /* Flat the list in the stream */
 tail          /* Return the last item in the stream */
}

Alternative 30 bytes:
{enum|[[#_,-_,_1]]|max|[_[2]]}

Try it online!

Writing up my jq answer made me realise that enum can be dropped, and instead the minimum from [[-#_,_1]] can be selected, https://tio.run/##K8pPSfyf9r86OlpXOV4n3jA2tiY3M68mvqYkMTOn9n9uYmaeQjUXZ7RSakppkZKOUn5@CZAsScwoUYpVqFFI46r9DwA

@Cowsquack That doesn't work because then min would compare strings secondarily alphabetically (because arrays are compared secondarily by their second item). For example input ["b", "a"] would give "a" as output. I should probably add a minby function to Röda or something similar...

SNOBOL4 (CSNOBOL4), 63 57 bytes
I	M =LT(SIZE(M),SIZE(X)) X
	X =INPUT	:S(I)
	OUTPUT =M
END

Try it online!
Input is on stdin and output on stdout.
Roughly translates to the following pseudocode:
while input exists
 x = input
 if length(m) < length(x)
  m = x
end
return m

Ruby, 21 20 bytes
->s{s.max_by &:size}

Try it online!
Trivial solution, thanks Snack for -1 byte

Take the &:size out of the parentheses for -1

Standard ML (MLton), 55 bytes
fun&(s::r)=foldl(fn(%,$)=>if size% >size$then%else$)s r

Try it online! Example usage: & ["abc","de","fgh"] yields "abc".
Ungolfed:
fun step (current, longest) =
    if size current > size longest
    then current
    else longest

fun longestString (start :: list) = foldl step start list
  | longestString nil = raise Empty

Try it online!

dc, 39 38 36 bytes
0sl[slssdd]sG[dZdll!>Gooz0<M]dsMxlsp

Try it online!
Edit: -1 byte, filling up empty space by 'd' instead
Edit: -2 bytes, thanks @brhfl for suggestion!

Looks like you can shave off a byte by moving the ? input behind (or in front of) your initial 0sl instead (or, typically it is allowed to just assume the stack is input, ? can likely be omitted for another byte), and then changing sMlMx to dsMx.

@brhfl thanks for suggestion!

Julia 0.6, 24 bytes
!s=s[indmax(length.(s))]

Try it online!

Funky, 38 bytes
a=>a[(v=a::map@#)::find(math.max...v)]

Explained
a=>a[(v=a::map@#)::find(math.max...v)]
        a::map@#                        $ Create a list of the lengths of the input's strings.
      v=                                $ And assign it to v.
     (          )::find(            )   $ Find the first index in this list that equals...
                        math.max...v    $ The largest value of v, eg. the length of the longest string.
   a[                                ]  $ Get the value at that position.

Try it online!

Bash, 44 bytes
IFS=$'\n';egrep -m1 .{`wc -L<<<"$*"`}<<<"$*"

Try it online!

Perl, 24 bytes
Includes +1 for p
Give words as lines on STDIN
perl -pe '$;[y///c]//=$_}{$_=pop@'
one
two
no
^D

C++, 125 bytes
Accepts input as a pair of iterators; returns an iterator to the longest string.  The array must not be empty (i.e. the iterators must be different).
#include<algorithm>
template<class I>I f(I a,I b){return std::max_element(a,b,[](auto&a,auto&b){return a.size()<b.size();});}

Demo
#include <string>
#include <iostream>
#include <iterator>
int main()
{
    std::string strings[] = { "Programming", "Puzzles", "and", "Code", "Golf" };

    std::cout << *f(std::begin(strings), std::end(strings)) << std::endl;
}

The definition of std::max_element() guarantees that

If several elements in the range are equivalent to the greatest element, returns the iterator to the first such element.

If you're using GCC, you can use #import<regex>.

Javascript ES5, 41 bytes
Since there was already a solution using sort...
Try it online
a=>a.reduce((x,y)=>x.length>=y.length?x:y)

APL+WIN, 11 bytes
s[↑⍒∊⍴¨s←⎕]

Prompts for screen input in the form 'abc' 'defg' hijklm'

Perl 5, 38 bytes
say((sort{$a=~y///c<=$b=~y///c}<>)[0])

Try it online!

Jelly, 4 bytes
LÐṀḢ

Try it online!
Maximum (ÐṀ) by length (L). Take Head (Ḣ).

Jelly, 4 bytes
ṚLÞṪ

Try it online!
Reverse. Sort by length. Take tail (last element).

Coconut, 15 13 bytes
max$(key=len)

Try it online!

Add++, 7 bytes
L,bU«bL

Try it online!
More interesting, 32 byte version:
L,vbU§bLdbLBkÞ{g}@
D,g,@,bLBK=

Try it online!
How they work
L,	; Create a lambda function
	; Example argument:         		[["two" "one" "abc" "no"]]
    bU	; Evaluate as list; 			STACK = ['two' 'one' 'abc' 'no']
    «bL	; Take the value with the max length;	STACK = ['two']

And the 32 byte version:
L,		; Create a lambda function
		; Example argument: 		['["two" "one" "no"]']
	vbU	; Evaluate;		STACK = ['two' 'one' 'no']
	§bL	; Sort by length;	STACK = ['no' 'two' 'one']
	dbLBk	; Save length;		STACK = ['no' 'two' 'one']	REGISTER = 3
	Þ{g}	; Filter by 'g';	STACK = ['two' 'one']
	@	; Reverse;		STACK = ['one' 'two']
		; Implicitly return the top element:   'two'

D,g,@,		; Create a function 'g'
		; Example argument:		['two']
	bL	; Length;		STACK =	[3]
	BK=	; Equal to register;	STACK = [1]

Attache, 9 bytes
MaxBy&:`#

Try it online!
This is simply bonding the size operator (`#) to the left of MaxBy. This is equivalent to:
f[x] := MaxBy[Size, x]

...which selects the first element with the largest size in x.

jq -r, 19 15 bytes
Golfed 4 bytes after learning min_by is a builtin.
min_by(-length)

Try it online!
(Without -r the output string is surrounded with "s.)

Kotlin, 21 bytes
{it.maxBy{it.length}}

Try it online!

I'm afraid that, if you don't count the whole function, it becomes a snippet, so it's invalid.

I've seen another kotlin answer somewhere else that did the same thing so I figured it might be valid; I'll switch it to a lambda

Lua, 70 64 bytes
function f(a,...)x=...and f(...)return x and#x>#a and x or a end

Try it online!
x is set to the second argument if that is falsy, otherwise the longest of the second argument and up. The function returns x if it is truthy and longer than the first argument, else the first argument.
No type-checking, so works not only for a sequence of strings, but for sequences containing tables, or anything with a __len metamethod that returns a number. For instance f("tiny", {1, 2, 3, 4, 5}, debug.setmetatable(6, { __len = function (self) return self end })) returns 6.
This technically breaks the rule of operating on an array (in Lua, a table) because it operates on an argument list, but operating on a table seemed more complicated (table.sort is not stable). A table can be unpacked into the function: f(table.unpack { 'oh', 'one', 'two' }).

Tcl, 93 bytes
proc c a\ b {expr [string le $a]<[string le $b]}
proc L l {return [lindex [lsort -c c $l] 0]}

Try it online!
Quite disappointed by the score, should/could be better. Thought about this one-proc version:
proc L l {
 set m  [lmap e $l {regsub -all . $e 1}]
 return [lindex $l [lsearch $m [expr max([join $m ,])]]]
}

but it's longer.

Vyxal, 2 bytes
ÞG

Try it Online!

Thunno 2, 2 bytes
ØG

Attempt This Online!
Built-in.

Mathematica, 29 bytes
#&@@#~MaximalBy~StringLength&

Pure function. Takes a list of strings as input and returns a string as output. #~MaximalBy~StringLength finds the longest strings in the list and #&@@ selects the first instance.

I've been trying to find an improvement on StringLength, which is pretty long. Sadly ByteCount doesn't grow one-to-one with the length of the string. Is there anything clever in this area?

Rust, 73 bytes
|mut x:Vec<String>|{x.sort_by(|a,b|b.len().cmp(&a.len()));x[0].clone()}

Very simple code, that can probably be golfed at least a little more. The fact that i had to use String instead of &str, just for the return value, bugs me alot. (I could have used a .to_string() method, but that wouldve added 2 bytes.)
Try it online!

MY, 24 bytes
1ω74ǵ'ƒ⇹(ω74ǵ'ƒ⇹(⍐=⍸@ω@←

Try it online!
How?
1ω74ǵ'ƒ⇹(ω74ǵ'ƒ⇹(⍐=⍸@ω@←
                       ← = Output ...
                      ω  = ... the input ...
                       @ = ... at ...
1                    @   = ... the first ...
                   ⍸     = ... truthy index of ...
 ω74ǵ'ƒ⇹(                = ... the length of each element of the input's ...
                  =      = ... equality with ...
         ω74ǵ'ƒ⇹(⍐       = ... the maximum length.

Java 8, 57 bytes (70 bytes)
By the power of streams, my java answer shall be the shortest
Arrays.stream(a).max(Comparator.comparing(String::length))

Honestly I don't know if I cheated with that answer because I don't return anything but you could use that line of code. If we really want to return stuff then it's a bit longer.
Thanks to LukeStevens for pointing out to use lambdas to be more golfy.
w->Arrays.stream(w).max(Comparator.comparing(String::length)).get()

Welcome to PPCG! An answer needs to be either a program or a function, a snippet of code is not enough. Also, input needs to be taken in some allowed way. Assuming that the input is stored in a predetermined variable is not allowed. You can take input for example from STDIN or as an argument to a function.

Hi @Steadybox I changed my program to a function(method). Is it ok now?

@ChristophE Unfortunately you need to include the byte cost of imports aswell :( which would add another 19 bytes to this, otherwise it's a really good solution! You should also have a look at using lamdbas which would reduce the code to w->Arrays.stream(w).max(Comparator.comparing(String::length)).get()

I think I don't understand completely, my code already uses lambdas :D but just the lambda expression counts as 'function' in codegolf? thats good to know then I'll change my answer

By the power of streams, my Java answer shall be the shortest: s->s.max((a,b)->a.length()-b.length()).get() (44 bytes).

haha "comparator.comparing" is just too long :D you win olivier. I don't know the rules of code golf, do you just post your own answer now or do I edit main and just give you credit?

@ChristophE Oh... generally PPCG users are nice, you can use others' idea with credit. Don't worry too much about it.

F# (.NET Core), 29 bytes
 Seq.maxBy <| fun s->s.Length

Try it online!
Explanation
Through partial application of Seq.maxBy, returns a function (string seq -> string)

Stacked, 19 bytes
[:$#'"!:MAX index#]

Try it online!
Explanation
[:$#'"!:MAX index#]
[                 ]   anonymous function, takes input as list of strings
 :$  "!               on each member:
   #'                   get the length
            index     get the index of...
       :MAX             the maximum length
                 #    and obtain the respective member in the array.

Alternatives
19 bytes: [[#'\#'-]sortby 0#]
24 bytes: [$#'"!:sorted index#_1#]

PHP, 69 bytes
usort($x,function($a,$b){return strlen($b)<=>strlen($a);});echo$x[0];

Not a trick or nice golfing, just sorting array by string length and then outputting the first element.

V, 27 23 21 20 bytes
Í./_
ÚGYu/"
uYHVGp

Try it online!
Explanation:
Í./_         In every line, replace every character by _
Ú            Sort alphabetically. Cursor ends up in first line
 GY          Go to last line, copy it
   u         Undo sort
    /"       Search for string in register " (the one that was just copied). Non-printable character is <C-r>
u            Undo replace, go to last cursor position. Non-printable character is <C-o> (thanks, Cows quack)
  Y          Copy line
   HVG       Go to first line, select all lines until last line
      p      Paste copied line into selection

Hexdump:
00000000: cd2e 2f5f 0ada 4759 752f 1222 0a75 0f59  ../_..GYu/.".u.Y
00000010: 4856 4770                                HVGp

You can change mmu'm to u'' ('' goes to the last cursor position) to save some bytes https://tio.run/##K/v//3Cvnn481@FZ7pGl@kJKXKXq6pEeYe4F//87ZebkcHmlJqWmZCZmcDnlJ3GFJeak5pVk5iVyheTn5lZyORalQ/lBmckZiUUpAA

Common Lisp, 32 bytes
(elt(sort(read)'> :key'length)0)

Try it online!

Husk, 3 bytes
►L↔

Try it online!
Explanation
  ↔  -- reverse the list (such that the first gets picked in case of a tie)
►L   -- find maximum by length

Scratch 2.0, 22 blocks
Accepts input by pressing see inside on the project page and manually adding and removing items from list.
Project here. Flash required to run and view, apologies.
All blocks were counted including nested ones. Not sure how I'd count bytes with this language unless you want the length of the JSON.

You might want to check out this question on meta.

@Timtech thanks a ton! Didn't even know scoring existed for Scratch. :P Probably should have done it in a "real" language.

05AB1E, 3 bytes
Réθ

Try it online!
Explanation
R     # reverse
 é    # sort by length
  θ   # get the last element

PHP, 59 bytes
while($n=strlen($s=$argv[++$i]))$n>$e&&$e=$n+!$r=$s;echo$r;

takes words as separate command line arguments. Run with -nr or try it online.

Google Sheets, 40 Bytes
Anonymous worksheet function that takes input from range A:A and outputs to the calling cell
=Index(A:A,Match(Max(Len(A:A)),Len(A:A),

APL NARS, 10 chars, 24 bytes
{⍵[↑⍒⍴¨⍵]}

note in the test, that: 'uno' it is not one array of array, so the array of correct deep is ,⊂'uno' instead
⎕fmt  ,⊂'uno'
  ┌1─────┐
  │┌3───┐│
  ││ uno││
  │└────┘2
  └∊─────┘

so in the test g fail for 'uno'
g←{⍵[↑⍒⍴¨⍵]}
g 'uno'
  u

but not fail for the correct type of input
g ,⊂'uno'
  uno
g 'uno' 'quattro' 'cinque'
  quattro
⎕fmt  g ,⊂''
  ┌───┐
  │┌0┐│
  ││ ││
  │└¯┘2
  └∊──┘

if the community think this is one too much big limitation: than there is the 18 chars solution
{1=≡⍵:⍵⋄∊⍵[↑⍒⍴¨⍵]}

that evade the problem in the first test calculate the deep of input
f←{1=≡⍵:⍵⋄∊⍵[↑⍒⍴¨⍵]}
f 'uno'
  uno
f 'uno' 'quattro' 'cinque'
  quattro

The problem of the input type of one Char in Apl as 'a' (it is consider from interpreter one char). We can transform that in one array of array of char, or one type list of arrays of deep 2 write ,⊂,'a'; so g ,⊂,'a' should return the correct answer of type array of array length 1

Please try not to make spelling and grammar error...

@user202729 for the spelling error this computer seems sufficient, for grammar error nothing

My computer clearly shows the warning.

@user202729 ok, I use one different phrase (for eccessive); thank you very much, and a good year

sed 4.2.2 -rz, 71 72 83 bytes
h
:
s/^.//gm
/[^\n]{2}/t
:b
/^\n/{s/.//
x
s/^[^\n]*.//
x}
tb
x
s/\n.*//

Try it online!

-r uses extended regular expressions, in other words, allows golifer syntax as we are able to save several \s
-z puts all lines of input into one "line", so that they would be processed at the same time rather than the normal cyclic processing.

This was a fun challenge seeing as sed did not have any builtin sort functions. The program works as follows:

copy the pattern space into the hold space
find the position of the longest line by repeatedly removing the first character from every line until we are remaining with line(s) with only a single character, this first of these is at the position of the longest line
to find which line this position corresponds to, we repeatedly

remove the first line of the pattern space and hold space until we encounter a non-newline character on the first line of the pattern space

now that the corresponding line is at the top of the hold space, we remove the other lines
the contents of the buffer is printed at the end of the program

C++ (gcc), 65 63 bytes
Accepts any container of std::string and returns via reference.
[](auto&c,auto&r){r=c[0];for(auto x:c)r=x.size()>r.size()?x:r;}

Try it online!
If you are tolerant to output, there is a 58 byte solution which alters the input list and copies the longest string to the first element:
[](auto&c){for(auto x:c)c[0]=x.size()>c[0].size()?x:c[0];}

Factor, 7 bytes
longest

Try it online!
Builtin

Uiua, 6 bytes
⊡⊢⍖∵⧻.

Try it!
⊡⊢⍖∵⧻.
     .  # duplicate
   ∵⧻   # lengths
 ⊢⍖     # index of maximum
⊡       # pick

Noulith, 33 bytes
\l->l find\w->w.len==max(l map len)

Try it online!
Explanation
\l->                                # lambda, taking in a list of strings
    l find                          # find in `l`...
          \w->                      # some word `w` such that...
              w.len                 # the length of `w`...
                   ==               # is equal to...
                     max(l map len) # the longest `w` in `l`

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Parse the Parcel
Thanks to your help in the Mark My Mail challenge, PPCG-Post has successfully stamped all of its parcels with the generated barcodes!
Now, it's time to decode them.
In this challenge your program will, given a barcode generated from the Mark My Mail challenge, decode it and return the encoded integer.
But watch out! The barcode might be upside down...

4-state barcodes
In the case you missed the encoding challenge you'll need to know what kind of barcodes we're talking about. A 4-state barcode is a row of bars with four possible states, each representing a base-4 integer:
            |       |
Bar:    |   |   |   |
                |   |

Digit:  0   1   2   3

Rendered in ASCII, the barcodes will take up three lines of text, using the pipe (|) character to represent part of a bar, and a space () to represent an empty section. There will be a single space in between each bar. An example barcode may look like this:

|   | |   | | | |   |     |   |
| | | | | | | | | | | | | | | | |
    | |   |   | | |   |     |

To convert a barcode back to the integer it encodes, map each bar to its corresponding base-4 digit, concatenate these, and convert it to decimal.
As each barcode will also represent a different barcode when upside down, we implement a start/stop sequence so the orienation can be calculated. For the purpose of this challenge, we will be using the start/stop sequence specified by Australia Post: each barcode begins and ends with a 1 0 sequence.

The Challenge
Your task is to, given an ASCII 4-state barcode, parse it and return the integer it encodes - essentially the reverse of Mark My Mail.
But to spice things up, there's a catch - the barcode may be given upside down. As in the real world, it will be left to the barcode reader (your program) to determine the correct orientation using the start/stop sequence.
Example:
Given the following barcode:

    | |   |     |
| | | | | | | | | | |
  | |     |   |     |

We can clearly see that the first and last pairs of digits are 0, 2 and not 1, 0. This means that the barcode is upside down - so we must rotate it by 180 degrees (not just flip each bar) to achieve the correct orientation:

|     |   |     | |
| | | | | | | | | | |
    |     |   | |

Now, we can begin the decoding. We map each bar to its corresponding base-4 digit, ignoring the start/stop sequences as they do not encode the data.

|     |   |     | |
| | | | | | | | | | |
    |     |   | |

- - 2 1 0 3 0 2 3 - -

We concatenate this to the base-4 integer 2103023, then convert it to its decimal representation 9419 for the final result.

Rules

The input will always be a valid, 4-state barcode, rendered in ASCII as set out above, with the described start/stop sequence.

You may request trailing spaces, or stripped lines, as well as a trailing newline - whichever format suits your golfing.
It may or may not be in the correct orientation - your program must determine whether to read it upside down, by using the start/stop sequence.
It will not encode leading zero-digits in the base-4 integer.

You may take the input as a list of lines, or a string with newlines.
The output should be an integer in your language's standard integer base, representing the data that was encoded by the barcode.
As postage stamps are small and can fit very little code on them, your code will need to be as short as possible: this is a code-golf - so the shortest program (in bytes) wins!

Test Cases

| | | | | | | | | | |
  |             |   |

= 4096 (flipped)

      | | | |     | | | |
| | | | | | | | | | | | | | | |
  | |   | |   | |   | |   |   |

= 7313145 (flipped)

    | |   |     |
| | | | | | | | | | |
  | |     |   |     |

= 9419 (flipped)

|   | | | |   |
| | | | | | | | |
    | |   | |

= 990 (not flipped)

|   |       |   | |
| | | | | | | | | | |
    |       | |

= 12345 (not flipped)

-1 the titles on the two posts aren't the same format.  ("P the P" vs "M my M", pick either 'the' or 'my' :p)

Would "list of lines" be any of [String], [{#Char}], [{Char}], [[Char]]?, given that String is equivalent to {#Char}

@Ouros What notation is that? I strongly suspect the answer is "yes", because data types are very different between languages, so coding challenges generally accept "whatever the equivalent is in your language", but I've no idea what different representations you're trying to represent.

What's next? Emit the email? Transmit the Telegram? Process the Post?

@Ourous yes, data type is flexible, as IMSoP described.

It's odd that you even have the middle line of characters, they will always be filled with |.

@MagicOctopusUrn It's most likely for ease of scanning by real-life barcode machines - my guess is that the scanner works best when there's always a bar, so in the case that there is neither an ascender (top part) nor a descender (bottom part), there is still the central section (called the tracker) of a bar.

@FlipTack am I allowed to remove that as part of the input or nah? Saves me 1 byte

@MagicOctopusUrn You can't remove it, it's a part of the barcode. Parsing the necessary information from the barcode is part of the challenge (that everyone else has managed to complete without complaint).

@FlipTack guess I more importantly should've asked if it can be taken as an array of 3 strings. That's what I really wanted to ask.

@MagicOctopusUm As stated in the question: You may take the input as a list of lines, or a string with newlines.

Jelly, 18 bytes
>⁶m2Zm2UFUi¡1ṫ4Ḅ:⁴

Try it online!

Husk, 16 bytes
ḋṁẊ=hhttĊ2T§▼↔m↔

Try it online!
Input is a list of lines (the TIO link uses a multiline string for clarity).
The lines must have equal lengths, and there must not be extra trailing spaces.
Explanation
ḋṁẊ=hhttĊ2T§▼↔m↔  Input is a list of strings x.
           §▼     Lexicographic minimum of
             ↔    x reversed and
              m↔  x with each line reversed.
          T       Transpose. Now we have a list of columns.
        Ċ2        Get every second column, removing the blank ones.
    hhtt          Remove first 2 and last 2 (the orientation markers).
 ṁ                Map and concatenate
  Ẋ=              equality of adjacent pairs.
                  This turns a column like "|| " into [1,0], and these pairs are concatenated.
ḋ                 Convert from binary to integer.

SOGL V0.12, 40 32 bytes
K@=«I⁷G@Κ¹;⌡I2n{j_{@≠}«+}¹jkjk4│

Try it Here!

Python 2, 113 105 bytes
lambda x:int(''.join([`2*(c>'#')+(a>'#')`for a,b,c in zip(*x[::1-2*(x[-1]>'#')].split('\n'))][4:-4:2]),4)

Try it online!

Pip, 46 43 42 bytes
IsQ@@gg:RV*RVgY^gR'|1(J@UW2*y@2+@y)TM2FB:4

Takes the lines of the barcode as three command-line arguments. The first and third lines must be padded to the length of the second line with spaces. Try it online!
Explanation
First some prepwork:
IsQ@@gg:RV*RVg Y^gR'|1

                        g is cmdline args; s is space (implicit)
IsQ                     If space equals
   @@g                  the first character of the first line, then:
           RVg           Reverse the order of the rows in g
        RV*              then reverse the characters in each row
      g:                 and assign the result back to g
                 gR'|1  In g, replace pipe character with 1
                ^       Split each row into a list of characters
               Y        Yank the result into y

Now observe that if we ignore the middle row and treat | as 1 and   as 0, each bar is just a 2-bit binary number:
(J@UW2*y@2+@y)TM2FB:4

       y@2             Third row
     2*                Multiply by 2, turning 1 into 2 and space into 0
           @y          First row
          +            Add
   UW                  Unweave: creates a list of two lists, the first containing all
                       even-indexed elements (in our case, the actual data), the second
                       containing all odd-indexed elements (the space separators)
  @                    First item of that list
 J                     Join the list of digits into a string
(            )TM2      Trim 2 characters from the beginning and end
                 FB:4  Convert from base 4 (: makes the precedence lower than TM)
                       Autoprint

Python 2, 96 bytes
lambda a:int(`[2*(r==q)+(p==q)for p,q,r in zip(*a[::(a>'|')*2-1].split('\n'))[4:-4:2]]`[1::3],4)

Try it online!

Retina, 71 bytes
(.).
$1
sO$^`^\|.*|.

^..|..¶.*¶..|..$
¶
\|
 |
+`\|
 ||||
.*¶$
$&$&
\|

Try it online! Link includes smaller test cases. Requires the first and last lines to be space-padded to the length of the middle line. Explanation:
(.).
$1

Delete the unnecessary spaces.
sO$^`^\|.*|.

Reverse the characters in the code, but if the bar code begins with a |, then select the entire code, otherwise split it in to characters. Then, reverse them. This flips the code if it begins with a 0.
^..|..¶.*¶..|..$
¶

Delete the start/stop sequence and the middle row (which is of no use to us).
\|
 |
+`\|
 ||||

Convert the spaces and |s from base 4 to unary.
.*¶$
$&$&

Double the last line.
\|

Convert to decimal.

Clean, 191 ... 161 144 bytes
import StdEnv
?' '=0;?_=1
r=reverse
$a b|hd a<'|'= $(r b)(r a)=[?(b!!n)*2+ ?(a!!n)\\n<-[4,6..length b-4]]
@[a,_,b]=sum[d*4^p\\d<- $a b&p<-[0..]]

Try it online!

Java 8, 208 166 157 151 bytes
Trying it, probably can be better, reduced 42 due unnecessary checks, -9 removing variables, -6 thanks to Luke Stevens

Input is a char[][3]
(a)->{int i=2,c,s=0;c=(a[0][0]>32)?1:-1;for(;i<a.length-2;i++){s+=((a[i][1-c]>32?1:0)+(a[i][1+c]>32?2:0))*Math.pow(4,c==1?a.length-i-3:i-2);}return s;}

ungolfed:
int b(char[][] a) {
    int i=2,c,s=0;                      //i for looping, c to check if it's reversed, s is the sum, n the number
    c=(a[0][0]>32)?1:-1; //Check if must be reversed

    for(;i<a.length-2;i++){         //Looping elements

            //(Checking value for 1 + Checking value for 2) * Power, if reversed increasing, else decreasing
        s+=((a[i][1-c]>32?1:0)+(a[i][1+c]>32?2:0))*Math.pow(4,c==1?a.length-i-3:i-2);
    }
    return s;
}

If you use an array of chars rather than Strings, you can check for | by using  >32 rather than =="|" which saves 2 bytes for each usage (6 overall). You can also remove the brackets around a when declaring the lambda for another two bytes.

Java (OpenJDK 8), 181 160 bytes
Not too shabby for a java solution, I'm sure there are optimisations I can make, but I've already been staring at this for too long.
Cut down a few bytes by shortening the loop rather than using substring.
Golfed

c->{String r="";Integer i,j,l=c[0].length;for(i=4;i<l-4;i+=2){j=c[0][0]>32?i:l-1-i;r+=c[0][j]%8/4*(j==i?1:2)+c[2][j]%8/4*(j==i?2:1)+"";}return l.parseInt(r,4);}

Try it online!
Ungolfed
String r = "";
Integer i, j, l = c[0].length;
for(i=4; i<l-4; i+=2){
    j = c[0][0]>32 ? i : l-1-i;
    r += c[0][j]%8/4 * (j==i?1:2) + c[2][j]%8/4 * (j==i?2:1) + "";
}
return l.parseInt(r, 4);

Just tried your code but with the reversed barcode of the example
"|   |             |"
"| | | | | | | | | | |"
and give me 1024,  Ok I cant format this, but the one on the example but, try the exmple you have but without reversing it, maybe I did a bad input :)

@JavaGonzalezArribas I tried the first example (non flipped) and it seems to works fine. Could it be you put one too few spaces in the first line of the input?

That probably is the problem, great answer :)

Suggest l+~i instead of l-1-i

Husk, 39 38 bytes
B4ththmȯ%4+3%5f≠192Ḟz+zṀ·*cN?↔m↔(='|←←

Takes input as a list of strings: Try it online or try the test-suite!
Explanation
B4ththm(%4+3%5)f≠192Ḟz+zṀ·*cN?↔m↔(='|←←)
                             ?   (='|←←)  -- if the very first character == '|'
                              ↔           --   reverse the lines
                                          -- else
                               m↔         --   reverse each line
                       zṀ·*cN             -- zip the lines with [1,2,3..] under..
                        Ṁ·*c              --   convert each character to its codepoint and multiply by one of [1,2,3]
                    Ḟz+                   -- reduce the lines under zipWith(+) (this sums the columns)

               f≠192                      -- only keep elements ≠ 192 (gets rid of the separating lines)

-- for the example from the challenge we would now have:
--   [652,376,468,652,376,744,376,468,744,652,376]

      m(      )                           -- map the following function
        %4+3%5                            --   λx . ((x % 5) + 3) % 4
-- this gives us: [1,0,2,1,0,3,0,2,3,1,0]
    th                                    -- remove first & last element
  th                                      -- remove first & last element
B4                                        -- interpret as base4 number

Perl 5, 152 + 2 (-F) bytes
push@a,[@F]}{for$i(0..$#{$a[1]}){$_.=($a[0][$i]eq'|')+2*($a[2][$i]eq'|')}$_=reverse y/12/21/r if/^0/;s/^0*1000|10*$//g;s/.\K0//g;$\=$_+$\*4for/./g;say$\

Try it online!

Octave, 80 75 68 bytes
@(b)bi2de({rot90(t=~~(b-32)([3,1],[1:2:end]),2),t}{2-t(2)}(5:end-4))

Try it online!
Curiously, bi2de is default MSB on the right rather than the left, leading to some headaches while I made this... I think I should have the optimal way of flipping the array before indexing it, but there are extremely many ways to do it (either in the first indexing, or with flipud, fliplr, rot90, ' (transpose), the final indexing...). Takes a rectangular array with spaces and |s (so, trailing spaces required)
@(b)                    % Define anonymous function taking input b

t=                      % Inline-define t,
~~(b-32)                % which is the input, converted to 1's and 0's,
([3 1],[1:2:end])       % but only keep the relevant rows (1 and 3 flipped vertically) and columns (only odd)

{rot90(t,2),t}          % Flip 180 degrees
{2-t(2)                 % depending on whether the second element of t is 1 or 0.}

(5:end-4)               % Flatten array, discarding control bits
bi2de( ... )            % and convert from binary to decimal,

JavaScript (ES6), 184 181 bytes
I'm not an experienced golfer - I'm sure this can be improved, but I loved this challenge! I've always wondered about those marks.
Function f takes a list of strings with required trailing spaces. Newlines added to the code below for clarity (not included in byte count).
f=t=>((o=[[...t[0]],[...t[2]]])[0][0]=='|'?o:(z=a=>a.reverse())(o.map(z)))
.map((a,r)=>a.filter((_,i)=>~i%2).map(e=>(1+r)*(e=='|')).slice(2,-2))
.reduce((a,b)=>a+parseInt(b.join``,4),0)

Usage
t=['                     ','| | | | | | | | | | |','  |             |   |']
console.log(f(t)) // 4096

Ungolfed version with explanation
// take list of strings, t, as input:
f = t => (

  // create output variable o, discard middle row, turn other rows into lists:
  ( o = [ [...t[0]], [...t[2]] ] )

  // if top-left position isn't a pipe, rotate 180 degrees.
  // Alias [].reverse to save 3 bytes :D
  [0][0] == '|' ? o : ( z = a=> a.reverse() )( o.map(z) )

).map( (a,r) =>

  // remove even-numbered positions (non-encoding spaces):
  a.filter( (_,i) => ~i%2 )

  // convert non-pipes into zeros, and pipes into 1 or 2;
  // top row becomes the base4 1-component, bottom row is 2:
  .map( e => (1+r) * (e=='|') ).slice(2,-2)

// convert rows to base4 component strings, then decimal, then sum them:
).reduce( (a,b) => a + parseInt(b.join``,4),0)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Google's Hopping Bunny
On December 4, 2017, the Google Doodle was a graphical programming game featuring a bunny. The later levels were nicely non-trivial and they seemed like a great candidate for an atomic-golf challenge.
Details
Game

There are four available moves: hop forward, turn left, turn right, and loop. Each of these moves is one token, corresponding to the fact that they are each one tile in the game.
The bunny can face four orthogonal directions (i.e. north, south, east, west).
The bunny can hop forward (move one square in the direction it's facing) and turn left or right.
Loops may have any number of other moves inside them, including other loops, and their iteration count is any positive integer (though the game technically allows an iteration count of 0).
The board is a set of grid-aligned squares and the bunny can hop between adjacent squares.
The bunny cannot hop into the void. Meaning that an attempt to hop off the board does nothing. (This was apparently a surprise for some people and a disappointment for others.)
Squares are either marked or unmarked. When the bunny is on a square, it becomes marked.
The level is complete when all squares are marked.
You may assume a solution exists.

Your code

Objective: given a board, find one or more shortest solutions.
Input is a list of square locations forming the board (distinguishing marked and unmarked squares) and output is a list of moves. Input and output format does not matter at all, so long as they are human-readable and understandable.
Winning criterion: sum of number of moves of shortest solutions found within one minute for each board. If your program does not find a solution for any particular board, your score for that board is (5 * number of squares).
Please do not hardcode solutions in any manner. Your code should be able to take any board as input, not just the ones given as examples below.

Examples
Solutions are hidden in spoilers to give you a chance to play the game first and attempt some of these yourself. Also, only one solution is provided below for each.
S is the bunny's starting square (facing east), # is an unmarked square, and O is a marked square. For moves, my notation is F = hop forward, L = turn left, R = turn right, and LOOP(<num>){<moves>} denotes a loop that iterates <num> times and does <moves> each time. If the loop can run any number of times beyond some minimum number, <num> may be omitted (i.e. infinity works).
Level 1:
S##

 F F

Level 2:
S##
  #
  #

 LOOP(2){F F R}

Level 3:
S##
# #
###

 LOOP{F F R}

Level 4:
###
# #
##S##
  # #
  ###

 LOOP{ F LOOP(7){F L} } (found by DJMcMayhem)

Level 5:
#####
# # #
##S##
# # #
#####

 LOOP(18){ LOOP(10){F R} L}
 Source: Reddit

Level 6:
 ###
#OOO#
#OSO#
#OOO#
 ###

 LOOP{ LOOP(3){F} L }

Huge boards: (shortest solutions currently unknown)
12x12:
S###########
############
############
############
############
############
############
############
############
############
############
############

Level 5 but way bigger:
#############
# # # # # # #
#############
# # # # # # #
#############
# # # # # # #
######S######
# # # # # # #
#############
# # # # # # #
#############
# # # # # # #
#############

More holey boards:
S##########
###########
## ## ## ##
###########
###########
## ## ## ##
###########
###########
## ## ## ##
###########
###########

and
S#########
##########
##  ##  ##
##  ##  ##
##########
##########
##  ##  ##
##  ##  ##
##########
##########

Finally, asymmetry can be a real pain in the butt:
#######
# ##  #
#######
###S###
# ##  #
# ##  #
#######

and
#########
# ##  ###
###S  ###
# #######
###    ##
#####   #
####  ###
#########
#########

Related.

"find one or more shortest solutions" I thought the halting problem prohibits this

@Leaky Nun This is not related to the halting problem. This is a graph search

But looping is allowed...

I think it doesn't apply because the board is finite. For each loop, it either runs forever, or halts. A loop with no loops inside of it will only loop forever if the argument for the number of iterations is dropped. In that case, the finite number of board states guarantees the loop will start repeating states, which can be checked for.

Funnily enough Google will give you the "shortest solution" ribbon without you getting the shortest solution.  It wasn't until I read this question that I realized you could adjust the length of the loop, but I got the ribbon for Loop(4){Loop(4){FFFL}} on the last puzzle.

I thought I pointed out that "shortest possible" is ambiguous (because you may think that it means "shortest possible globally"), use "shortest possible your program can" is better?

Yes... WhatToDo is correct, like halting problem on finite memory Turing machine is decidable/computable.

@user202729: "possible" appears nowhere in my challenge text. I think the rest of the text clearly implies that programs don't need to find the absolute minimum.

"400. That’s an error. Your client has issued a malformed or illegal request. That’s all we know." I am getting this error when I click on the link, but most of the page appears to be intact. Might want to check that out.

@Laurel: I hard-refreshed and it loads fine for me in Chrome. Not sure what the issue might be. Try a different browser, perhaps?

I'm on Chrome on Mac. This is what I see. What's there exactly? Still not sure where I can play the game.

@Laurel: Cracked open my MacBook to check and I can confirm it works in Chrome on El Capitan. What you should be seeing is a Google Doodle with the game that inspired this challenge. Both this and this suggest clearing your browser cookies.

Python 3, 67 tokens
import sys
import time

class Bunny():
    def __init__(self):
        self.direction = [0, 1]
        self.coords = [-1, -1]

    def setCoords(self, x, y):
        self.coords = [x, y]

    def rotate(self, dir):
        directions = [[1, 0], [0, 1], [-1, 0], [0, -1]]
        if dir == 'L':
            self.direction = directions[(directions.index(self.direction) + 1) % 4]
        if dir == 'R':
            self.direction = directions[(directions.index(self.direction) - 1) % 4]

    def hop(self):
        self.coords = self.nextTile()

    # Returns where the bunny is about to jump to
    def nextTile(self):
        return [self.coords[0] + self.direction[0], self.coords[1] + self.direction[1]]

class BoardState():
    def __init__(self, map):
        self.unvisited = 0
        self.map = []

        self.bunny = Bunny()
        self.hopsLeft = 0

        for x, row in enumerate(map):
            newRow = []
            for y, char in enumerate(row):
                if char == '#':
                    newRow.append(1)
                    self.unvisited += 1

                elif char == 'S':
                    newRow.append(2)

                    if -1 in self.bunny.coords:
                        self.bunny.setCoords(x, y)
                    else:
                        print("Multiple starting points found", file=sys.stderr)
                        sys.exit(1)

                elif char == ' ':
                    newRow.append(0)

                elif char == 'O':
                    newRow.append(2)

                else:
                    print("Invalid char in input", file=sys.stderr)
                    sys.exit(1)

            self.map.append(newRow)

        if -1 in self.bunny.coords:
            print("No starting point defined", file=sys.stderr)
            sys.exit(1)

    def finished(self):
        return self.unvisited == 0

    def validCoords(self, x, y):
        return -1 < x < len(self.map) and -1 < y < len(self.map[0])

    def runCom(self, com):
        if self.finished():
            return

        if self.hopsLeft < self.unvisited:
            return

        if com == 'F':
            x, y = self.bunny.nextTile()
            if self.validCoords(x, y) and self.map[x][y] != 0:
                self.bunny.hop()
                self.hopsLeft -= 1

                if (self.map[x][y] == 1):
                    self.unvisited -= 1
                self.map[x][y] = 2

        else:
            self.bunny.rotate(com)

class loop():
    def __init__(self, loops, commands):
        self.loops = loops
        self.commands = [*commands]

    def __str__(self):
        return "loop({}, {})".format(self.loops, list(self.commands))

    def __repr__(self):
        return str(self)

def rejectRedundantCode(code):
    if isSnippetRedundant(code):
        return False

    if type(code[-1]) is str:
        if code[-1] in "LR":
            return False
    else:
        if len(code[-1].commands) == 1:
            print(code)
            if code[-1].commands[-1] in "LR":
                return False

    return True

def isSnippetRedundant(code):
    joined = "".join(str(com) for com in code)

    if any(redCode in joined for redCode in ["FFF", "RL", "LR", "RRR", "LLL"]):
        return True

    for com in code:
        if type(com) is not str:
            if len(com.commands) == 1:
                if com.loops == 2:
                    return True

                if type(com.commands[0]) is not str:
                    return True

                if com.commands[0] in "LR":
                    return True

            if len(com.commands) > 1 and len(set(com.commands)) == 1:
                return True

            if isSnippetRedundant(com.commands):
                return True

    for i in range(len(code)):
        if type(code[i]) is not str and len(code[i].commands) == 1:
            if i > 0 and code[i].commands[0] == code[i-1]:
                return True
            if i < len(code) - 1 and code[i].commands[0] == code[i+1]:
                return True

        if type(code[i]) is not str:
            if i > 0 and type(code[i-1]) is not str and code[i].commands == code[i-1].commands:
                return True
            if i < len(code) - 1 and type(code[i+1]) is not str and code[i].commands == code[i+1].commands:
                return True

            if len(code[i].commands) > 3 and all(type(com) is str for com in code[i].commands):
                return True

    return False

def flatten(code):
    flat = ""
    for com in code:
        if type(com) is str:
            flat += com
        else:
            flat += flatten(com.commands) * com.loops

    return flat

def newGen(n, topLevel = True):
    maxLoops = 9
    minLoops = 2
    if n < 1:
        yield []

    if n == 1:
        yield from [["F"], ["L"], ["R"]]

    elif n == 2:
        yield from [["F", "F"], ["F", "L"], ["F", "R"], ["L", "F"], ["R", "F"]]

    elif n == 3:
        for innerCode in newGen(n - 1, False):
            for loops in range(minLoops, maxLoops):
                if len(innerCode) != 1 and 0 < innerCode.count('F') < 2:
                    yield [loop(loops, innerCode)]

        for com in "FLR":
            for suffix in newGen(n - 2, False):
                for loops in range(minLoops, maxLoops):
                    if com not in suffix:
                        yield [loop(loops, [com])] + suffix

    else:
        for innerCode in newGen(n - 1, False):
            if topLevel:
                yield [loop(17, innerCode)]
            else:
                for loops in range(minLoops, maxLoops):
                    if len(innerCode) > 1:
                        yield [loop(loops, innerCode)]

        for com in "FLR":
            for innerCode in newGen(n - 2, False):
                for loops in range(minLoops, maxLoops):
                    yield [loop(loops, innerCode)] + [com]
                    yield [com] + [loop(loops, innerCode)]

def codeLen(code):
    l = 0
    for com in code:
        l += 1
        if type(com) is not str:
            l += codeLen(com.commands)

    return l

def test(code, board):
    state = BoardState(board)
    state.hopsLeft = flatten(code).count('F')

    for com in code:
        state.runCom(com)

    return state.finished()

def testAll():
    score = 0
    for i, board in enumerate(boards):
        print("\n\nTesting board {}:".format(i + 1))
        #print('\n'.join(board),'\n')
        start = time.time()

        found = False
        tested = set()

        for maxLen in range(1, 12):
            lenCount = 0
            for code in filter(rejectRedundantCode, newGen(maxLen)):
                testCode = flatten(code)
                if testCode in tested:
                    continue

                tested.add(testCode)

                lenCount += 1
                if test(testCode, board):
                    found = True

                    stop = time.time()
                    print("{} token solution found in {} seconds".format(maxLen, stop - start))
                    print(code)
                    score += maxLen
                    break

            if found:
                break

    print("Final Score: {}".format(score))

def testOne(board):
    start = time.time()
    found = False
    tested = set()
    dupes = 0

    for maxLen in range(1, 12):
        lenCount = 0
        for code in filter(rejectRedundantCode, newGen(maxLen)):
            testCode = flatten(code)
            if testCode in tested:
                dupes += 1
                continue

            tested.add(testCode)

            lenCount += 1
            if test(testCode, board):
                found = True
                print(code)
                print("{} dupes found".format(dupes))
                break

        if found:
            break

        print("Length:\t{}\t\tCombinations:\t{}".format(maxLen, lenCount))

    stop = time.time()
    print(stop - start)

#testAll()
testOne(input().split('\n'))

This program will test a single input board, but I find this test driver more useful. It will test every single board at the same time and print how long it took to find that solution. When I run that code on my machine (Intel i7-7700K quad core CPU @ 4.20 GHz, 16.0 GB RAM), I get the following output:
Testing board 1:
2 token solution found in 0.0 seconds
['F', 'F']

Testing board 2:
4 token solution found in 0.0025103092193603516 seconds
[loop(17, [loop(3, ['F']), 'R'])]

Testing board 3:
4 token solution found in 0.0010025501251220703 seconds
[loop(17, [loop(3, ['F']), 'L'])]

Testing board 4:
5 token solution found in 0.012532949447631836 seconds
[loop(17, ['F', loop(7, ['F', 'L'])])]

Testing board 5:
5 token solution found in 0.011022329330444336 seconds
[loop(17, ['F', loop(5, ['F', 'L'])])]

Testing board 6:
4 token solution found in 0.0015044212341308594 seconds
[loop(17, [loop(3, ['F']), 'L'])]

Testing board 7:
8 token solution found in 29.32585096359253 seconds
[loop(17, [loop(4, [loop(5, [loop(6, ['F']), 'L']), 'L']), 'F'])]

Testing board 8:
8 token solution found in 17.202533721923828 seconds
[loop(17, ['F', loop(7, [loop(5, [loop(4, ['F']), 'L']), 'F'])])]

Testing board 9:
6 token solution found in 0.10585856437683105 seconds
[loop(17, [loop(7, [loop(4, ['F']), 'L']), 'F'])]

Testing board 10:
6 token solution found in 0.12129759788513184 seconds
[loop(17, [loop(7, [loop(5, ['F']), 'L']), 'F'])]

Testing board 11:
7 token solution found in 4.331984758377075 seconds
[loop(17, [loop(8, ['F', loop(5, ['F', 'L'])]), 'L'])]

Testing board 12:
8 token solution found in 58.620323181152344 seconds
[loop(17, [loop(3, ['F', loop(4, [loop(3, ['F']), 'R'])]), 'L'])]

Final Score: 67

This last test just barely squeaks in under the minute restriction.
Background
This was one of the most fun challenges I've ever answered! I had a blast pattern hunting and looking for heuristics to cut down on things.
Generally, here on PPCG I tend to answer relatively easy questions. I'm especially fond of the string tag because it's generally pretty well suited for my languages. One day, about two weeks ago, I was looking through my badges and I realized that I had never gotten the revival badge. So I looked through the unanswered tab to see if anything caught my eye, and I found this question. I decided that I would answer it no matter the cost. It ended up being a bit harder than I thought it would, but I finally got a brute-force answer that I can say I'm proud of. But this challenge is totally out of the norm for me since I don't usually spend more than an hour or so on a single answer. This answer took me a little over 2 weeks and at least 10+ of work to finally get to this stage, though I wasn't keeping careful track.
The first iteration was a pure brute force solution. I used the following code to generate all snippets up to length N:
def generateCodeLenN(n, maxLoopComs, maxLoops, allowRedundant = False):
    if n < 1:
        return []

    if n == 1:
        return [["F"], ["L"], ["R"]]

    results = []

    if 1:
        for com in "FLR":
            for suffix in generateCodeLenN(n - 1, maxLoopComs, maxLoops, allowRedundant):
                if allowRedundant or not isSnippetRedundant([com] + suffix):
                    results.append([com] + suffix)

    for loopCount in range(2, maxLoopComs):
        for loopComs in range(1, n):
            for innerCode in generateCodeLenN(loopComs, maxLoopComs, maxLoops - 1, allowRedundant):
                if not allowRedundant and isSnippetRedundant([loop(loopCount, innerCode)]):
                    continue

                for suffix in generateCodeLenN(n - loopComs - 1, maxLoopComs, maxLoops - 1, allowRedundant):
                    if not allowRedundant and isSnippetRedundant([loop(loopCount, innerCode)] + suffix):
                        continue

                    results.append([loop(loopCount, innerCode)] + suffix)

                if loopComs == n - 1:
                    results.append([loop(loopCount, innerCode)])

    return results

At this point, I was sure that testing every single possible answer would be way too slow, so I used isSnippetRedundant to filter out snippets that could be written with a shorter snippet. For example, I would refuse to yield the snippet ["F", "F", "F"] because the exact same effects could be achieved with [Loop(3, ["F"]), so if it we get to the point where we test length-3 snippets, we know that no length-3 snippet could solve the current board. This used a lot of good mnemonics, but ultimately was waaaay too slow. Testcase 12 took just over 3,000 seconds using this approach. This is clearly significantly too slow. But using this information and a bunch of computer cycles to brute force short solutions to every board, I could find a new pattern. I noticed that almost every solution found would generally look like something like the following:
[<com> loop(n, []) <com>]

nested several layers deep, with the single coms on each side being optional. This means that solutions like:
["F", "F", "R", "F", "F", "L", "R", "F", "L"]

would never appear. In fact, there was never a sequence of more than 3 non-loop tokens. One way to utilize this would be to filter out all of these and not bother to test them. But generating them was still taking a non-negligible amount of time, and filtering through the millions of snippets like this would barely cut time off. Instead I drastically rewrote the code-generator to only generate snippets following this pattern. In pseudo code, the new generator follows this general pattern:
def codeGen(n):
    if n == 1:
        yield each [<com>]

    if n == 2:
        yield each [<com>, <com>]

    if n == 3:
        yield each [loop(n, <com length 2>]
        yield each [loop(n, <com>), <com>]

    else:
        yield each [loop(n, <com length n-1>)]
        yield each [loop(n, <com length n-2>), <com>]
        yield each [<com>, loop(n, <com length n-2>)]

        # Removed later
        # yield each [<com>, loop(n, <com length n-3>), <com>]
        # yield each [<com>, <com>, loop(n, <com length n-3>)]
        # yield each [loop(n, <com length n-3>), <com>, <com>]

This cut the longest test case down to 140 seconds, which is a ridiculous improvement. But from here, there were still some things I needed to improve. I started more aggressively filtering out redundant/worthless code and checking to see if code has been tested before. This cut it down further, but it wasn't enough. In the end, the final piece that was missing was the loop counter. Through my highly advanced algorithm (read: random trial and error) I determined that the optimal range to allow loops to run in is [3-8]. But there's a huge improvement in there: If we know that [loop(8, [loop(8, ['F', loop(5, ['F', 'L'])]), 'L'])] can't solve our board, then there's absolutely no way that [loop(3, [loop(8, ['F', loop(5, ['F', 'L'])]), 'L'])] or any loop count from 3-7 could solve it. So rather than iterating through all the loop sizes from 3-8, we set the loop count on the outer loop to the max. This ends up cutting the search space down by a factor of maxLoop - minLoop, or 6 in this case.
This helped a lot, but ended up inflating the score. Certain solutions I had found earlier by brute force require larger loop numbers to run (for example, boards 4 and 6). So rather than setting the outer loop count to 8, we set the outer loop count to 17, a magical number also calculated by my highly advanced algorithm. We know we can do this because increasing the loop count of the outermost loop has no effect on the solution's validity. This step actually reduced our final score by 13. So not a trivial step.


text:
Communistic Substring Normalization

If a string T of length K appears K or more times in a string S, then it is potentially communistic. For example, 10 in 10/10 is potentially communistic, for it appears 2 times and is of length 2. Note that these substrings cannot overlap.
A communistic transformation is one that takes this string T and moves each character ti of T to the i occurrence of T in S. So, for the previous example, the communistic transformation would yield 1/0; the first char of 10 replaces 10 the first time 10 is found, and 0 the second time.
A communistic normalization is a function that takes all such strings T with K ≥ 2 and performs a communistic transformation on them.
Some specifics on the algorithm:

Perform communistic transformations on the longest valid strings T first. Favor the first occurrences of T.
Then, perform communistic transformations on the next-longest strings, then the next-next-longest... etc.
Repeat until no such strings exist in the string.

Note that some strings, such as the "Hello, Hello" example in the test cases, can be interpreted two different ways.  You can use ell for T, but you can also use llo.  In this case, your code can choose either option.  The shown test case uses llo, but you may get a different and equally valid output.

Your task is to implement communistic normalization. The input will only ever consist of printable ASCII characters (0x20 to 0x7E, space to tilde). You may write a program or function to solve this task; the input may be taken as a line from STDIN, string/character array argument, argument from ARGV, etc.
Test cases
'123' -> '123'
'111' -> '111'
'1111' -> '11'
'ABAB' -> 'AB'
'111111111' -> '111'
'asdasdasd' -> 'asd'
'10/10' -> '1/0'
'100/100+100' -> '1/0+0'
'   +   +   ' -> ' + '
'Hello, hello, dear fellow!' -> 'Hel he, dear feow!' OR 'Heo hl, dear flow!'
'11122333/11122333/11122333' -> '112/13' OR '132/23'

'ababab1ababab' -> 'a1bab'
'1ab2ab3ab4ab5ab6' -> '1a2b3a4b5ab6'

Worked out test case
Format is 'string', 'substring', at each step of replacement.  Replaced bits are bracketed.
'11[122]333/11[122]333/11[122]333', '122'
'111[333]/112[333]/112[333]', '333'
'1113/11[23]/11[23]', '23'
'11[13]/112/1[13]', '13'
'1[11]/[11]2/13', '11'
'1[/1]12[/1]3', '/1'
'112/13', ''

Another test case:
'Hello, hello, dear fellow!', 'llo'
'Hel, hel, dear feow!', 'l,'
'Hel he, dear feow!', ''

Reference code (Python)
You may find this useful to visualize the algorithm.
#!/usr/bin/env python

import re

def repeater(string):
    def repeating_substring(substring):
        return (string.count(substring) == len(substring)) and string.count(substring) > 1

    return repeating_substring

def get_substrings(string):
    j = 1
    a = set()
    while True:
        for i in range(len(string) - j+1):
            a.add(string[i:i+j])
        if j == len(string):
            break
        j += 1
    return list(a)

def replace_each_instance(string, substring):
    assert `string`+',', `substring`
    for i in substring:
        string = re.sub(re.escape(substring), i, string, 1)

    return string

def main(s):
    repeats = repeater(s)
    repeating_substr = filter(repeater(s), get_substrings(s))

    while repeating_substr:
        repeating_substr.sort(lambda x,y: cmp(len(y), len(x)))
        s = replace_each_instance(s, repeating_substr[0])
        repeating_substr = filter(repeater(s), get_substrings(s))

    return s

assert main('123') == '123'
assert main('111') == '111'
assert main('1111') == '11'
assert main('ABAB') == 'AB'
assert main('111111111') == '111'
assert main('asdasdasd') == 'asd'
assert main('10/10') == '1/0'
assert main('100/100+100') == '1/0+0'
assert main('   +   +   ') == ' + '
assert main('Hello, hello, dear fellow!') == 'Hel he, dear feow!'
assert main('11122333/11122333/11122333') == '112/13'

Thanks to @ConorO'Brien for posting the original idea of this challenge.

Test cases: ababab1ababab, 1ab2ab3ab4ab5ab6

Why is there no change? ab occurs at least twice in both strings.

@Zgarb looks like my tester is bad, I'll fix it later. Fixing the test cases manually though.

Pyth, 22 bytes
u.xse.iLcGdf>cGTlTt#.:

Test suite
To actually see what the program is doing, check out this:
Internals
In particular, the program always uses the final-occuring replacement of the longest replacements.
Explanation:
u.xse.iLcGdf>cGTlTt#.:
u.xse.iLcGdf>cGTlTt#.:G)GQ    Implicit
u                        Q    Starting with the input, repeat the following
                              until a fixed point is reached.
                    .:G)      Construct all substrings of the current value
                              ordered smallest to largest, front to back.
                  t#          Filter on having more than 1 element.
                              These are the eligible substrings.
           f                  Filter these substrings on
             cGT              Chop the current value on the substring,
            >   lT            Then remove the first len(substring) pieces.
                              The result is nonempty if the substring is
                              one we're looking for.
                              Chopping gives nonoverlapping occurrences.
     .iL                      Interlace the substrings with
        cGd                   Chop the current value on that substring
   se                         Take the final result, make it a string.
 .x                     G     If there weren't any, the above throws an error,
                              So keep the current value to halt.

JavaScript (ES6), 121 bytes
f=(s,j=2,o,m=s.match(`(.{${j}})(.*\\1){${(j-1)}}`))=>m?f(s,j+1,s.split(m[1]).map((e,i)=>e+(m[1][i]||'')).join``):o?f(o):s

Recursively matches the pattern:
(.{2})(.*\1){1}  //2 characters, repeated 1 time
(.{3})(.*\1){2}  //3 characters, repeated 2 times
(.{4})(.*\1){3}  //4 characters, repeated 3 times
etc.

… until the pattern isn't found.  (This guarantees that the longest string is handled first.)
It then performs the "communistic transformations" on the last-found pattern, by splitting on the match, and joining on each of the match's characters.  (map is used for this purpose.  Too bad join doesn't take a callback.)
It finally recurses on this new string until it is no longer communistic.
Test cases:

f=(s,j=2,o,m=s.match(`(.{${j}})(.*\\1){${(j-1)}}`))=>m?f(s,j+1,s.split(m[1]).map((e,i)=>e+(m[1][i]||'')).join``):o?f(o):s

console.log(f('123'));  //123
console.log(f('111'));  //111
console.log(f('1111')); //11
console.log(f('ABAB')); //AB
console.log(f('111111111')); //111
console.log(f('asdasdasd')); //asd
console.log(f('10/10')); //1/0
console.log(f('100/100+100')); //1/0+0
console.log(f('   +   +   ')); // +
console.log(f('Hello, hello, dear fellow!')); //Heo hl, dear flow!
console.log(f('11122333/11122333/11122333')); //132/23

Clean, 420 ... 368 bytes
import StdEnv,StdLib
l=length
%q=any((==)q)
?_[]=[]
?a[(y,x):b]|isPrefixOf a[x:map snd b]=[y: ?a(drop(l a-1)b)]= ?a b
$s=sortBy(\a b=l a>l b)(flatten[[b: $a]\\(a,b)<-map((flip splitAt)s)[0..l s-1]])
f s#i=zip2[0..]s
#r=filter(\b=l(?b i)>=l b&&l b>1)($s)
|r>[]#h=hd r
#t=take(l h)(?h i)
=f[if(%n t)(h!!hd(elemIndices n t))c\\(n,c)<-i|not(%n[u+v\\u<-t,v<-[1..l h-1]])]=s

Try it online!

This answer is invalid. See here. That should be changed, see the test cases.

@Riker interesting, since it's a direct port of the reference solution. I'll delete until it's fixed.

@Riker fixed now.