text:
Emoticon numbers!
(related)
Your challenge is to output the highest number you can. You can output as a number or as a string. You must output something that matches the regex ^\d+$, as in only 0-9.
The Twist
Your source code must be:

Same forwards and backwards
3 bytes long
The middle byte must be different from the other two

Example valid:
0_0
)-)
m.m
xvx
W$W
@\@

Example invalid:
mnop
l__l
___
T_+
O_o
0_o

Snippets are allowed, you don't need a full program / function.
Highest number outputted wins!

This is easy to brute force for any language.

@cairdcoinheringaahing highest number wins

@xnor true, but will produce intresting submissions.

Why the downvotes? This was +2 in the sandbox

@programmer5000 Perhaps because its trivial, boring, and leaves little room for interesting solutions? I haven't voted on it, but this might be why it stands currently at +1/-4

I downvoted because there are so few possible answers that it's impossible to be at all imaginative, and for most languages the optimal answer is the same (989, 9^9, 9e9, ...).

@Doorknob actually, many of the answers below use none of those.

All of which are, notably, esolangs. (And if you're counting by number of languages, the majority of them do.)

Is there a time limit?

"You must output something that matches the regex ^\d+$" - So e isn't allowed in the output at all?

Quick, someone find a language in which 0/0 is Infinity. It's NaN in JS :/

@StephenS "You must output something that matches the regex ^\d+$"

@programmer5000 Since snippets are allowed, does this mean that it could be assumed that the value returned is wrapped in a format call of some form - ie, could a snippet that outputs as 9000000000.0 or 9.00E+09 be assumed to return 9000000000? - (this would add 16+ languages onto my polyglot :P )

@StephenS - I did it :P ; With 0/0 MATL takes input, implicitly convert to a numeric, and devides it by 0. This outputs Inf for all inputs which do not implicitly convert to 0.

Can someone tell me what J outputs for _ _?

@carusocomputing I'm getting no output from that for particular string

I wonder what the lowest number would be... probably just 000 in most languages.

Jelly, 103000
ȷ*ȷ

Try it online!
How it works
ȷ denotes an scientific-notational number, as in 2ȷ6 for 2000000. Without digits on either side, it defaults to a value of 1000. * is exponentiation, giving 10001000.

Polyglot (28+ Langs), \$9\times10^9\$
Works With:
APL, AWK, Arcyou, C#, CJam, Convex, Excel, Google Sheets, J, Japt, Java, JavaScript, MATL, MATLAB, MY-BASIC, Perl 5, Perl 6, PHP,  PowerShell, Python, R, RProgN, TI-BASIC, Uiua, VB, VB.NET, VBA, VBScript
This is a polyglot, if it works in your language add it to the list
9e9

or
9E9

or (Pretty much only for TI-BASIC)
9ᴇ9

Try it Online. (VB.Net)
(dependant on language)

Added Uiua thanks to @RomanPro100
Added APL and J thanks to @Adám
Added Python thanks to @VoteToReopen
Added Japt thanks to @Shaggy
Added Perl 5/6 thanks to @bradgilbertb2gills
Added PowerShell thanks to @tessellatingheckler
Added C# thanks to @TheLethalCoder
Added Visual Basic Family
Added R thanks to @JarkoDubbeldam
Added AWK, Arcyou, CJam, Convex, MATL, MATLAB, PHP, RProgN, TI-Basic, MY-BASIC
Added Java thanks to @KevinCruijssen
Added Excel and Google Sheets

Note: With formatting, supported by: Clojure, Common Lisp, Crystal, D, Go, Haskell, Java, Julia, Kotlin, Lua, Maxima, NIM, Racket, Rexx, Ruby, Rust, Scala

Works in APL and J.

Was this downvoted because it is a snippet,? If so, note that snippets have been allowed by the OP. If not, I fail to see why "this answer is not useful" applies.

Brute force for J. 9E9 (or 9e9) is the largest possible value.

Works in Japt.

Works in Perl 5 and Perl 6.

I'm tempted to downvote this because it's pretty much an exact copy of programmer5000's answer, but since you don't have enough rep to see deleted things yet, I'll pass on calling you out for that. Have an upvote instead ;P

@HyperNeutrino programmer5000's answer had been down voted and deleted for the reason he answered his own challenge with a trivial solution before even waiting for answers. I think posting another solution is pretty legitimate in such a case, I mean, someone had to post this.

@Uriel Yes; I said I'd pass on saying it's a dupe partially because this is the obvious answer and because this answerer can't see that post in the first place.

I believe this should be turned into a community wiki

Apparently this works in C# too (who knew?).

As per my previous comment, I submitted a brute-forcer for this challenge, as an idea in the sandbox: https://codegolf.meta.stackexchange.com/a/12804/571

@HyperNeutrino someone mentioned it in the comments on Sandbox, so that's why programmer5000 posted it, probably.

@StephenS That would be a good explanation. Thanks.

I think it is safe to add R as well.

Already on the board as JS @CraigAyre :P but thanks - I'll correct my abbreviation

Works in Java as well. The lowercase and uppercase letters at least, the third one with ᴇ doesn't work.

Works in Uiua

Brainfuck, 255
-+-

Assuming 8-bit bounded cells.

Per this meta consensus, the contents of the tape post-execution may be used as a Turing machine's output.

You could also go for -.- which outputs the ASCII character code 255, and is also a relatively common emoticon.

@ZackC. I thought about it, but . will print ÿ where the question demands matching \d+. outputting through tape contents seemed to oversee this because it uses numbers (until printed).

By assuming larger cells (I think 32-bit cell interpreters exist, possibly even 64-bit cells), you can get bigger values!

@CalculatorFeline yea, but then I can claim for 1024, 2048, 4096... and there's no end (storage boundaries are not assumable). so I took on the common specs (and implementations) that lists 8 as a default when one exists.

"Languages are defined by their interpreters", so if you can find a 9999999999999999-bit interpreter, you can get 2^9999999999999999-1.

@CalculatorFeline python's int are almost unbeatable, so surely an interpreter that uses the whole RAM for calculating this overflow design can come to trillions of bits.

Python's integers are signed, so this would produce -1. You'd need an interpreter that wraps, finitizing the byte count.

@CalculatorFeline I meant there could be an interpreter that tries to produce the highest possible number in case of overflow

the contents of the tape post-execution may be used as a Turing machine's output

Japt, 1.001001001001001e+299 = 100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100
Found a bigger one thanks to ETHproductions informing me that strings were permitted.
LçL

Try it

Explanation

L is the Japt constant for the number 100.
The ç method, which takes string s as an argument, when applied to a number n, repeats s n times. If a number is passed as the argument, it's cast to a string.
So, reading LçL backwards, it's "100 repeated 100 times".

Original, 10200
LpL

Try it

Explanation please.

Explanation added, @CalculatorFeline.

05AB1E, 100! (93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000)
!т!

Try it online!
т is the constant 100 and the first ! is just ignored.

Ah! ! > ° I see.

Mathematica, 387420489
this one
9^9

Mathematica,  3265920
9!9

9^9 is a larger number.

yes I realised it right after I posted it :-)

Vim, 999999999
9i9

Since snippets are allowed, this works in vim as well as V, so you'll have to hit escape after this.
Try it online!

05AB1E, 10e100
°т°

Try it online!
also it looks more like a uterus than a face...

Looks like a bear face to be

QBIC, 10
?z?

The challenge specifically asks to "output" the number, and the only way to do that in QBIC is using ?. So this prints z (which is 10 in QBIC) followed by 2 newlines.
A slightly more relaxed take on the rules would give us this snippet:
z^z

which is good for 10,000,000,000. It doesn't output anything (in fact, it doesn't even assign the result), but as a 3-byte ABA snippet it reaches the highest number possible.

Brachylog, 39916800
ḟjḟ

Try it online!
Explanation
ḟ      Factorial: the Input is a free variable, so it considers that its input is 0
 j     Juxtapose: 11
  ḟ    Factorial: 39916800

Japt, 2550
#ÿ#

3 bytes in extended ASCII, where ÿ has code 255. # gets it's code and returns it, while the second # returns simply 0, because nothing follows it.
Try it online!
Japt, 91
Really bad score. That's just an experiment
;I;

Try it online!
;I;
;   Alternative variables mode
 I  Constant for 91
  ; Command separator - does nothing

Japt, ~1e+102 (cheating?)
Probably not valid answer, because Japt is transpiled to JS which automatically converts numbers to scientific notation.
LeL

It's basically 100^100.
Try it online!

I don't see why XeX would be cheating; 9e9 is the best possible answer in a number of languages, including JS. And even if scientific notation was cheating, this technically isn't using it, because e is actually a method here, multiplying the first number by 10 to the second ;-)

Braingolf, 126
#~#

Try it online!
Yep, that's as high as Braingolf can go under these restrictions.
Explanation:
#~   Pushes codepoint of ~ (126)
  #  Does nothing
     Implicit output of last item on stack

Yabasic, \$2^{1024}−2^{971}\$
Yabasic appears to have handle division by zero by returning the maximum double float value of \$2^{1024}−2^{971} \approx 1.797693134862316\times10^{308}\$. This means the snippet
0/0

returns a value of
1797693134862315708145274237317043567980705675258449965989174768031572
6078002853876058955863276687817154045895351438246423432132688946418276
8467546703537516986049910576551282076245490090389328944075868508455133
9423045832369032229481658085593321233482747978262041447231687381771809
19299881250404026184124858368.

Try it online!
Note: the Print command converts any number with a length greater than 10 digits to scientific notation, so a Using command is used to print the value without converting it to scientific notation

Is this some kind of integer overflow?

Psi, 99980001

Not super inventive. And it's probably cheating.
I'd love to use Operator: Power instead, but the "base" and "power" arrows are different colors, making it not symmetrical.

Aceto, 387420489
Since snippets are allowed,
9F9

may push 9^9 on the stack, depending on where in the code it is. An example of it working would be:
 9F9
   p

(the p merely prints, you could replace it with a nop and it would still work)


text:
"Multiply" two strings
 This was inspired by a function I recently added to my language Add++. Therefore I will submit an  short answer in Add++ but I won't accept it if it wins (it wouldn't be fair)
Don't you hate it when you can multiply numbers but not strings? So you should correct that, right?
You are to write a function or full program that takes two non-empty strings as input and output their multiplied version.
How do you multiply strings? I'll tell you!
To multiply two strings, you take two strings and compare each character. The character with the highest code point is then added to the output. If they are equal, simply add the character to the output.
Strings are not guaranteed to be equal in length. If the lengths are different, the length of the final string is the length of the shortest string. The input will always be lowercase and may contain any character in the printable ASCII range (0x20 - 0x7E), excluding uppercase letters.
You may output in any reasonable format, such as string, list etc. Be sensible, integers aren't a sensible way to output in this challenge.
With inputs of hello, and world!, this is how it works
hello,
world!

w > h so "w" is added ("w")
o > e so "o" is added ("wo")
r > l so "r" is added ("wor")
l = l so "l" is added ("worl")
d < o so "o" is added ("worlo")
! < , so "," is added ("worlo,")

So the final output for hello, and world! would be worlo,.
More test cases
(without steps)
input1
input2 => output

programming puzzles & code golf!?
not yet graduated, needs a rehaul => prtgyetmirgduuzzlesneedsde rolful

king
object => oing

blended
bold => boln

lab0ur win.
the "super bowl" => the0usuwir.

donald j.
trumfefe! => trumlefj.

This is a code-golf so shortest code wins! Luok!

This is the elementwise maximum of the strings, right? That doesn't seem anything like multiplying.

Nitpick: PPCG has graduated, we just didn't get a new design yet.

Possible relevant: https://codegolf.stackexchange.com/questions/74809/merging-two-strings/123187#123187

The first test case is wrong. It should be "input1","input2" => "input2".

@a'_' That‘s not a test case; it’s a Demonstration of the Format of the other test cases

Haskell, 11 bytes
zipWith max

Try it online!
Nothing much to explain.

And I thought Mathematica had strange built-ins

@Mr.Xcoder Mathematica has zipWith, it's called MapThread

@Mr.Xcoder actually, zipWith isn't too strange.  It's a fairly common  functional primitive.  The idea of "zipping" two lists together comes up in many problems, and once you do that, you often want to apply some function to the resulting 2-element items, hence the "with" part.

05AB1E, 4 bytes
øΣà?

Uses the 05AB1E encoding. Try it online!

I feel like ø€à should work, but it don't.

Looks more like a question than an answer lol

@MagicOctopusUrn ø€à does work now (in the legacy version of 05AB1E), but the output will be a list of characters instead of a string: try it online.

Japt, 16 bytes
ñl g îUy ®¬ñ oÃq

Test it online! Takes input as an array of two strings.
Lack of min and max built-ins hurt Japt here, but it still manages to pull off a somewhat decent score...
Explanation
 ñl g îUy ®   ¬ ñ oÃ q
Uñl g îUy mZ{Zq ñ o} q
                        // Implicit: U = input array     ["object", "king"]
       Uy               // Transpose the strings of U.   ["ok", "bi", "jn", "eg", "c ", "t "]
          mZ{      }    // Map each string Z to
             Zq ñ o     //   the larger of the two chars. (Literally Z.split().sort().pop())
                        //                               ["o", "i", "n", "g", "c", "t"]
                     q  // Join into a single string.    "oingct"
Uñl g                   // Sort the two input strings by length and take the shorter.
      î                 // Trim the previous result to this length.
                        //            "king"î"oingct" -> "oing"
                        // Implicit: output result of last expression

PHP>=7.1, 52 Bytes
for(;$t=min(~$argv[1][$i],~$argv[2][$i++]);)echo~$t;

PHP Sandbox Online
PHP>=7.1, 69 Bytes
for([,$a,$b]=$argv;(~$c=$a[$i])&&~$d=$b[$i++];)$r.=max($c,$d);;echo$r;

PHP Sandbox Online
PHP>=7.1, 70 Bytes
for([,$a,$b]=$argv;(~$c=$a[$i])&&~$d=$b[$i++];)$r.=$c>$d?$c:$d;echo$r;

PHP Sandbox Online

Slightly golfed: for(;$t=min(~$argv[1][$i],~$argv[2][$i++]);)echo~$t;.

Jelly, 5 bytes
żœ-"«

Try it online!
How it works
żœ-"«  Main link. Arguemts: s, t (strings)

ż      Zipwith; form all pairs of corresponding characters from s and t.
       If one of the strings is longer than the other, its extra characters are
       appended to the array of pairs.
    «  Dyadic minimum; get all minima of corresponding characters.
       This yields the characters themselves for unmatched characters.
 œ-"   Zipwith multiset subtraction; remove a single occurrence of the minimum from
       each character pair/singleton.
       This yields the maximum for pairs, but an empty string for singletons.

Example
Let s = blended and t = bold.
ż yields ["bb", "lo", "el", "nd", 'd', 'e', 'd']. The last three elements are characters.
« is the vectorizing, dyadic minimum, so it yields ['b', 'l', 'e', 'd', 'd', 'e', 'd'].
œ-" removes exactly one occurrence of the nth character in the second array from the nth string/character in the first array, yielding ["b", "o", "l", "n", "", "", ""]. œ- is the multiset subtraction atom, and the quick " makes it vectorize.
When printed, this simply reads boln.

So, this is zipping, then taking the multiset difference of something, then there are some nice double quotes of misterious meaning, and finally the minimum. Nice... Explanation, please? :D

I've added a worked example.

JavaScript (ES6), 47 45 bytes

f=
(a,b)=>a.replace(/./g,(c,i)=>c>b[i]?c:[b[i]])

<input id=a><input id=b>

Conveniently c>b[i] returns false past the end of b. Edit: Saved 2 bytes thanks to @ETHproductions.

Here in my cellphone that above code can not be executed. In the PC desktop the above examples I say can run ok, but not allow to change input for functions... Why not use Tio instead?

@RosLuP When the input is simple (2 stings in this case) I prefer to use a Stack Snippet that normally makes it easier to change the inputs and the output updates dynamically too.

Alice, 8 bytes
/oI\
@m+

Try it online!
Explanation
Alice also has this operator (which I called superimpose) but it doesn't limit the output to the shorter string's length (instead, the remaining characters of the longer string are appended). However, it also has an operator to truncate the longer of two strings to the length of the shorter one.
/   Reflect to SE, switch to Ordinal. The IP bounces diagonally up and down
    through the code.
m   Truncate, doesn't really do anything right now.
I   Read a line of input.
    The IP bounces off the bottom right corner and turns around.
I   Read another line of input.
m   Truncate the longer of the two input lines to the length of the shorter.
+   Superimpose: compute their elementwise maximum.
o   Output the result.
@   Terminate the program.

Retina, 28 bytes
{O^`
G`.
^.+$

M!\*`^.
Rm`^.

Try it online!
Explanation
{O^`

The { tells Retina to run the entire program in a loop until it fails to change the working string. O makes this a sorting stage which sorts non-empty lines by default. The ^ option reverses the result. So in effect, we get a reverse sort of the two lines if they're non-empty, putting the line with the larger leading character at the top.
G`.

Discard empty lines if there are any.
^.*$

If only one line is left, one of the lines was empty, and we remove the other one as well to stop the process.
M!\*`^.

Lots of configuration going on here. This matches (M) the first character in the working string (^.), returns it (!), prints it without a trailing linefeed (\) and then reverts the working string to its previous value (*). In other words, we simply print the first character of the working string (which is the maximal leading character) without actually changing the string.
Rm`^.

Finally, we remove the first character from each line, so that the next iteration processes the next character.

When you commented on my how tall are the monoliths answer, it occurred to me that my answer to this question was far too long, and that perhaps I was transposing inefficiently. After looking at how your transposition suggestion worked I decided that it wasn't appropriate for this question after all. I then came up with a new approach that saved me 19 bytes... and then scrolled down to find you'd already come up with a better version...

You can save 3 bytes since the G`. is unnecessary, although this does output an extra newline which you can remove by using ^.+¶$ or by prefixing a \ to the start of the answer.

@Neil Oh good point. I could also use the latest commit (which isn't on TIO yet and probably isn't gonna be for a while) where I've made printing without trailing linefeeds the default (I could then also drop the other \).

Perl 6, 22 bytes
{[~] [Zmax] @_».comb}

As a bonus, it accepts any number of multiplicands, not just two.

Jelly, 6 bytes
żḊ€ṁ@»

Try it online!

żṢ€Ḋ€ and żṢ€ZṪ both save a byte.

@Dennis very clever.

C, 58 bytes
f(char*s,char*t){putchar(*s>*t?*s:*t);*++s&&*++t&&f(s,t);}

Try Online

-8 bytes @Steadybox

Darn, f(s,t)char*s,*t;{ gives the same length.

Husk, 2 bytes
z▲

Try it online!
"Ungolfed"/Explained
Makes use of zip f that truncates the shorter list such that there are always two arguments for f, e.g. zip f [1,2] [3,4,5] == zip f [1,2] [3,4] == [f 1 3, f 2 4]:
z   -- zip the implicit lists A,B with  - e.g. "ab" "bcd" (lists of characters)
 ▲  -- maximum                          -      [max 'a' 'b', max 'b' 'c']
    -- implicitly print the result      -      "bc"

Javascript (ES2015), 66 63 49 bytes
a=>b=>[...a].map((c,i)=>c>b[i]?c:b[i]||'').join``

Explanation:
a=>b=>                       // Function with two string parameters
  [...a]                     // Split a into array of characters
    .map((c, i) =>           // Iterate over array
      c>b[i] ? c : b[i]||'') //   Use the character with the larger unicode value until the end of the larger string
    .join``                  // Join the array into a string

Previous Versions:
//ES2015
a=>b=>[...a].map((c,i)=>c>b[i]?c:b[i]).slice(0,b.length).join``    //63
a=>b=>a.split``.map((c,i)=>c>b[i]?c:b[i]).slice(0,b.length).join`` //66
a=>b=>a.split``.map((c,i)=>c>b[i]?c:b[i]).slice(0,Math.min(a.length,b.length)).join``   //85
a=>b=>{for(i=-1,c='';++i<Math.min(a.length,b.length);)c+=a[i]>b[i]?a[i]:b[i];return c}  //86
a=>b=>{for(i=-1,c='';++i<Math.min(a.length,b.length);)c+=a[d='charCodeAt'](i)>b[d](i)?a[i]:b[i];return c}   //105
a=>b=>a.split``.map((c,i)=>c[d='charCodeAt']()>b[d](i)?c:b[i]).slice(0,Math.min(a.length,b.length)).join``  //106

//With array comprehensions
a=>b=>[for(i of a.split``.map((c,i)=>c>b[i]?c:b[i]))i].slice(0,b.length).join``                             //79
a=>b=>[for(i of a.split``.map((c,i)=>c>b[i]?c:b[i]))i].slice(0,Math.min(a.length,b.length)).join``          //98
a=>b=>[for(i of ' '.repeat(Math.min(a.length,b.length)).split``.map((_,i)=>a[i]>b[i]?a[i]:b[i]))i].join``   //105
a=>b=>[for(i of Array.apply(0,Array(Math.min(a.length,b.length))).map((_,i)=>a[i]>b[i]?a[i]:b[i]))i].join`` //107
a=>b=>[for(i of a.split``.map((c,i)=>c[d='charCodeAt']()>b[d](i)?c:b[i]))i].slice(0,Math.min(a.length,b.length)).join``        //119
a=>b=>[for(i of ' '.repeat(Math.min(a.length,b.length)).split``.map((_,i)=>a[d='charCodeAt'](i)>b[d](i)?a[i]:b[i]))i].join``   //124
a=>b=>[for(i of Array.apply(0,Array(Math.min(a.length,b.length))).map((_,i)=>a[d='charCodeAt'](i)>b[d](i)?a[i]:b[i]))i].join`` //127

Welcome to PPCG! Nice first post!

Python 2, 47 44 34 bytes
-3 bytes thanks to musicman523. -10 bytes thanks to Blender.
Takes input as a list of strings.
lambda a:''.join(map(max,zip(*a)))

Try it online!

V, 28, 24, 21 bytes
Í./&ò
dd{JdêHPÎúúx
Íî

Try it online!
Hexdump:
00000000: cd2e 2f26 f20a 6464 7b4a 64ea 4850 cefa  ../&..dd{Jd.HP..
00000010: fa78 0acd ee                             .x...

Three bytes saved thanks to @nmjcman101!
Explanation:
Í             " Globally substitute:
 .            "   Any character
  /           " With:
   &          "   That character
    ò         "   And a newline
dd            " Delete this line
  {           " Move to the first empty line
   J          " Delete this line
    dê        " Columnwise delete the second word
      HP      " Move to the first line, and paste the column we just deleted
        Î     " On every line:
         úú   "   Sort the line by ASCII value
           x  "   And delete the first character
Í             " Remove all:
 î            "   Newlines

Is the dG necessary?  Don't all of the newlines get removed with the Íî anyways?

@nmjcman101 It's needed in case the strings are different lengths.

Mathematica, 78 bytes
FromCharacterCode[Max/@Thread[#~Take~Min[Length/@x]&/@(x=ToCharacterCode@#)]]&

There is another answer in Mathematica already. This answer take input as a list of strings, so /@ can be used on # instead of {##}. And we can just Map the long function name on object instead of assigning it to variables. (in fact, each Mathematica built-in symbol name is used at most once in the function)

Java 8, 124 120 117 63 bytes
a->b->{for(int i=0;;i++)System.out.print(a[i]>b[i]?a[i]:b[i]);}

-4 bytes thanks to @Khaled.K.
-3 bytes thanks to @Jakob.
Inputs are two character-arrays, and it stops with an ArrayIndexOutOfBoundsException.
Explanation:
Try it here.
a->b->{                       // Method with two char-array parameters and no return-type
  for(int i=0;;i++)           //  Loop `i` from 0 up indefinitely (until an error is given)
    System.out.print(         //   Print:
      a[i]>b[i]?a[i]:b[i]);}  //    The character that has the highest unicode value

MATL, 8 bytes
otX>cwA)

Input is a cell array of strings, in the format {'abcd' 'efg'}
Try it online!
As an aside, this also works for more than two strings.
Explanation
Consider input {'blended' 'bold'}. The stack is shown upside down, with more recent elements below.
o    % Implicitly input a cell array of strongs. Convert to numeric
     % vector of code points. This right-pads with zeros if needed
     %   STACK: [98 108 101 110 100 101 100;
                 98 111 108 100   0   0   0]
tX>  % Duplicate. Maximum of each column
     %   STACK: [98 108 101 110 100 101 100;
                 98 111 108 100   0   0   0],
                [98 111 108 110 100 101 100]
c    % Convert to char
     %   STACK: [98 108 101 110 100 101 100;
                 98 111 108 100   0   0   0],
                'bolnded'
w    % Swap
     %   STACK: 'bolnded'
                [98 108 101 110 100 101 100;
                 98 111 108 100   0   0   0]
A    % All: gives true (shown as 1) for columns containing only nonzeros
     %   STACK: 'bolnded'
                [1 1 1 1 0 0 0]
)    % Use as logical index (mask). Implicitly display
     %   STACK: 'boln'

Kotlin, 50 41 37 bytes
-9 bytes with function reference syntax
-4 bytes with extension function
fun String.x(o:String)=zip(o,::maxOf)

If s, and x are in scope, and not in a function, this method is only 16 bytes
s.zip(x,::maxOf)

Demo

Here's a try.kotlinlang.org link: https://try.kotlinlang.org/#/UserProjects/ulm4nriigeio44jq1sdqer9sg2/spr3ucr6j9dr45e3od7nepsoie

You can use a lambda for 23 bytes: {a,b->a.zip(b,::maxOf)}

C#, 81 78 bytes
a=>b=>{var s="";try{for(int q=0;;q++)s+=a[q]>b[q]?a[q]:b[q];}catch{}return s;}

C# has implicit char to int conversion (because a char is actually an int underneath) which is nice, and instead of looking for shortest string just try until failure

Beat me to it! However, save one byte with currying a=>b=> by compiling to a Func<string, Func<string, string>>. You can remove the braces around the for loop to save 2 bytes.

Side note: C# has implicit char to int conversion is true because a char is an int underneath.

@TheLethalCoder:  Not quite.  sizeof(int) == 4 but sizeof(char) == 2.

R, 103 bytes
Code:
n=min(sapply(y<-strsplit(scan(,"",sep="\n"),""),length));cat(mapply(max,el(y)[1:n],y[[2]][1:n]),sep="")

Test cases:
> n=min(sapply(y<-strsplit(scan(,"",sep="\n"),""),length));cat(mapply(max,el(y)[1:n],y[[2]][1:n]),sep="")
1: programming puzzles & code golf!?
2: not yet graduated, needs a rehaul
3:
Read 2 items
prtgretmirgduuzzlesneedsde rolful
> x <- scan(,"",sep=NULL)
1: asd asd
3:
Read 2 items
> n=min(sapply(y<-strsplit(scan(,"",sep="\n"),""),length));cat(mapply(max,el(y)[1:n],y[[2]][1:n]),sep="")
1: king
2: object
3:
Read 2 items
oing
> n=min(sapply(y<-strsplit(scan(,"",sep="\n"),""),length));cat(mapply(max,el(y)[1:n],y[[2]][1:n]),sep="")
1: lab0ur win.
2: the "super bowl"
3:
Read 2 items
the0usuwir.

Huh? Max works like that? TIL

79 bytes!

Excel, 86 bytes
=LET(x,SEQUENCE(MIN(LEN(A1),LEN(A2))),d,MID(A1,x,1),e,MID(A2,x,1),CONCAT(IF(d>e,d,e)))

ah, another actuary on code golf! Are you FSA or FCAS? I'm still working my way towards my ACAS. Also, I don't have the courage to golf in Excel.

I'm an ASA health actuary.  Excel will never be the shortest but it's an interesting challenge to get it to work on these problems.

JavaScript (ES6), 47 bytes
f=([S,...s],[T,...t])=>S&&T?(S>T?S:T)+f(s,t):''

A recursive solution, which walks the string, always outputting the largest character.
Snippet:

f=([S,...s],[T,...t])=>S&&T?(S>T?S:T)+f(s,t):''

console.log(f('programming puzzles & code golf!?','not yet graduated, needs a rehaul'));
console.log(f('king','object'));
console.log(f('blended','bold'));
console.log(f('lab0ur win.','the "super bowl"'));
console.log(f('donald j.','trumfefe!'));

Python 3, 29 bytes
lambda*a:''.join(map(max,*a))

Try it online!

Coconut, 17 bytes
''.join<..map$max

Try it online!

CJam, 12 bytes
q~z{1/~e>o}%

Input is a list of two strings. The program exits with an error (after producing the right output) if the two strings have different lengths.
Try it online!
Explanation
q~              e# Read input and evaluate
  z             e# Zip: list of strings of length 2, or 1 if one string is shorter
   {      }%    e# Map this block over list
    1/          e# Split the string into array of (1 or 2) chars
      ~         e# Dump the chars onto the stack
       e>       e# Maximum of two chars. Error if there is only one char
         o      e# Output immediately, in case the program will error

Julia 0.5, 33 bytes
Pretty much the same concept as Python2, but shorter.
a->join(map(maximum,(zip(a...))))

Try it online!

28 bytes in Julia 1.0

Add++, 8 bytes
D,f,@@,^

Try it online!
In versions 0.4 through 1.11, ^ exponents two numbers or "multiplies" two strings, depending on the type of the arguments.

This is rather against the spirit of code-golf, to post a question knowing that your own language (that nobody else uses) has a built-in which gives it a monopoly. Thankfully, Jelly's conciseness wins again.

@FlipTack did you read the first line of the question? Even if this was 0 bytes, it wouldn't win.

@StephenS It seems that the feature inspired the challenge, not the other way round. The non-competing label is reserved for answers which use languages or features that were only implemented after the challenge.

Clojure, 31 bytes
#(map(comp last sort list)% %2)

Yay for function composition :) Returns a sequence of characters instead of a string, but they mostly work the same way in Clojure except when printing or regex matching.
Sadly max does not work with characters.

max doesn't work, but max-key does. #(map(partial max-key int)% %2) It's the exact same byte count, though.

Oh cool, I had forgotten about that. A lot simpler than for example (ffirst (sort-by second ...).

Retina, 55 36 bytes
^
¶
{O`¶.*
}`¶.(.*)¶(.)
$2¶$1¶
1!`.*

Try it online! Explanation: A line is prefixed to hold the result. While both strings still have characters left the inputs are sorted and the leading character with the highest code point is moved to the result while the other leading character is deleted. Finally the result is printed.

J, 25 bytes
>./&.(a.&i.)@(<.&#{."1,:)

explanation
half the bytes go to solving ensuring both inputs have the shorter inputs length (would love to see an improvement on this portion, if anyone has one):
(<.&#{."1,:)

<.&# is the minimum of the two lengths, and {."1,: takes that many characters from both rows of the 2-row table consisting of the left string stacked on top of the right one.
>./&.(a.&i.)

Use the Under verb &. to convert each character to its ascii index, take the maximum of the two numbers, and then convert back to characters.
Try it online!

21 bytes [:>./&.(3&u:)<.&#$&>;

@miles, elegant combination of train and conjunction -- i need to use that trick more to avoid parens.  also u: was a TIL for me.

Java 8 + Eclipse Collections, 70 64 bytes
a->b->a.zip(b).collect(p->(char)Math.max(p.getOne(),p.getTwo()))

a and b are both MutableList<Character> from eclipse collections.

Aceto, 43 bytes
]w(x^
o|p
d(
do
X0l)x
`=`X(
€(=0p
rr€l<

Explanation:
First, we read the first string, and explode it, then we move a stack to the left, read the second string, and explode it:
€(
rr€

Now, we check for emptiness of either of the stacks and exit if that is the case:
X0l)
`=`X
  =0
   l

Next, we duplicate the top letter of both stacks, and convert them to code points, then move them both (and us) on the right stack:
]
o
d(
do

The w tests if something is less or equal. If so, we get mirrored to the right. Otherwise, we print the top letter, go on the left stack, drop the top element (the other letter) and move up (^), which moves us on the bottom <, which moves us back to the length check.
 w(x^
 |p

If however, the test was truthy, we get mirrored into the emptiness on the right, and we need to do the opposite. Eventually we reach the three commands that now drop, then move to the left stack and print its top element. The < is the same symbol we land on in the other case, so here too we are lead back to the length check.
x
(
p
<

This repeats until one of the length checks succeeds, i.e. if one of the input strings is exhausted.

PowerShell, 75 bytes
-join(1..(($a,$b=$args)|sort l*)[0].length|%{(,$a[$_-1],$b[$_-1]|sort)[1]})
#            ^input array unpack
#       ^string index generation offset by 1
#                         ^sort by length property, so output length matches shorter input
#                                           ^loop over indices
#                                       max of the two characters^
# ^output join

Save as .ps1 file and run
PS C:\> .\Get-MultipliedString.ps1 'hello,' 'world!'
worlo,

Previously, 78 bytes:
$i=0;-join$(while(($a=$args[0][$i])-and($b=$args[1][$i++])){($a,$b)[$b-gt$a]})

APL (Dyalog), 22 bytes
Takes two (or more!) strings as right argument.
{⎕UCS⌈⌿⎕UCS↑⍵↑¨⍨⌊/≢¨⍵}

Try it online!
{ an anonymous function where the right argument is represented by ⍵
 ⎕UCS the symbols from the Unicode Character Set which correspond to the
 ⌈⌿ maximum value in each column of
 ⎕UCS the code points from the Unicode Character Set for the
 ↑ matrified (matrix from list of strings)
 ⍵ arguments
 ↑¨⍨ each capped at the
 ⌊/ minimum of
 ≢¨ the lengths
 ⍵ of the arguments
}

A slightly different take {⎕UCS⍺(⌊⍥⍴⍴⌈⍥⎕UCS)⍵}

@1_am_Jack That's amazing. Why don't you post that yourself? Also, I think it can be just ⎕UCS⌊⍥⍴⍴⌈⍥⎕UCS or as I would put it ⎕UCS⌊⍥≢↑⌈⍥⎕UCS

Thanks. tio.run doesn't appear to like that function composition operator... wasn't sure if having a way to try it online was a requirement.

@1_am_Jack I realise now that it won't work, because ⌈⍥⎕UCS is applied first, and will LENGTH ERROR :-( However, for next time: TIO is running an old version of Dyalog APL. ⍥ is available in Dyalog Extended or you can "poly-fill" it in the Header field as Ö←{(⍵⍵ ⍺)⍺⍺(⍵⍵ ⍵)} (and then use Ö instead of ⍥).

Good to know, thanks for your help. I only came across APL a month ago, your code golf answers have been very helpful

@1_am_Jack Great to hear. Are you aware of https://apl.chat and https://apl.wiki? How about APL Seeds?

Just apl.wiki. Though I've been referring to aplcart.info, and watching code_report videos on youtube. I'll check out those others. Thanks again.

k, 14 bytes
{|/(&/#:'x)$'x}

Examples:
k)F:{|/(&/#:'x)$'x}
k)F("hello,";"world!")
"worlo,"

q translation:
{max(min count each x)$/:x}

Free interpreter available here

Can you provide a Try It Online or similar? At the moment, K doesn't produce the correct output on Kona or oK

I added a link to download the interpreter. Kona is an implementation of an old version of k. oK is an implementation of the k6 spec (http://kparc.com/k.txt), which doesn't have a reference implementation from kx yet.

J, 22 bytes
0({"1\:~@,"0/)<.&#$&>;

Try it online!
Explanation
0({"1\:~@,"0/)<.&#$&>;  Input: string x (LHS), string y (RHS)
                 #      Get length of x and y
              <.&       Minimum of those
                     ;  Link x and y as a pair of boxed strings
                  $&>   Shape each to the minimum length
         ,"0/           Reduce by joining elementwise
     \:~@               Grade down each pair
0 {"1                   Select the value at index 0 from each

unfortunately my idea f=:{.@/:~"1@|:@,: has trailing spaces and fails when one or other string is one character long

Java, 158 151 bytes
Golfed:
String s(String a,String b){String r="";for(int i=0;i<Math.min(a.length(),b.length());i++){char c=a.charAt(i);char d=b.charAt(i);r+=c>d?c:d;}return r;}

Ungolfed:
String s(String a,String b) {
    String r = "";
    for(int i=0; i < Math.min(a.length(),b.length()); i++) {
        char c = a.charAt(i);
        char d = b.charAt(i);
        r += c > d ? c : d; //absolute ternary abuse
    }
    return r;
}

Takes two strings in a and b.

I think you could save a few bytes by getting rid of the outside ternary if statement  (r+=c==d?c:) since if they are equal you can add either c or d to the string and it won't make a difference.

79 bytes: a->b->r->{for(int i=0;i<a.length&ib[i]?a[i]:b[i]);}, which is a Function<char[],Function<char[],Consumer<StringBuilder>>> and outputs by modifying the StringBuilder.

Prolog (SWI), 55 bytes
[A|T]*[B|U]-[C|R]:-(A>B,C=A;C=B),T*U-R.
[]*_-[].
_*L-L.

Try it online!

Japt, 9 bytes
Can't seem to do better than 9. Takes input as a 2D array of characters, outputs an array of characters
ñÊÕfÎËñ Ì

Try it (header formats the input)
ñÊÕfÎËñ Ì     :Implicit input of 2D array
ñ             :Sort by
 Ê            :  Length
  Õ           :Transpose, padding the shorter array with null if necessary
   f          :Filter by
    Î         :  First element (removing the arrays that contain null)
     Ë        :Map
      ñ       :  Sort
        Ì     :  Last element

Knight, 70 51 48 bytes
;=aP;=bP W&a b;O+A I>a bAaAb"\";=aGa 1La=bGb 1Lb

Try it online!
Ungolfed & explained:
; = a PROMPT                                  # a = input()
; = b PROMPT                                  # b = input()
: WHILE & a b                                 # while a != "" and b != "":
    ; OUTPUT + ASCII IF > a b ASCII           #
               a ASCII b "\"                  #    print(a[0] if a > b else a[1]) # (without newline)
    ; = a GET a 1 LENGTH a                    #    a = a[1:]
    : = b GET b 1 LENGTH b                    #    b = b[1:]

-19 bytes thanks to Adam.
-3 bytes thanks to Bubbler.

51 bytes: ;=aP;=bP W&a b;O+I>AaAbA AaA Ab"\";=aGa 1La=bGb 1Lb. However, I think this program relies on undefined behavior for GET, since (LENGTH a)+1 is outside the bounds of the string.

@Adam Thanks. Undefined behavior is accepted as long as it works.

Oh, I didn't know that, thanks.

You can factor out the A of A Aa and A Ab out of I, and simplify >AaAb to >a b (because a>b guarantees a[0]>=b[0] and not(a>b) guarantees a[0]<=b[0]).

@Bubbler It doesn't actually save bytes to factor out A A because then it requires more spaces. It does save 1 though by using >a b

No, only one A. So I>a bA AaA Ab -> A I>a bAaAb.

Go, 131 121 bytes
func f(a,b string)(o string){
if""==a||b==""{o=""}else{A,B:=a[:1],b[:1]
if A>B{o+=A}else{o+=B}
o+=f(a[1:],b[1:])}
return}

Attempt This Online!

-10 by @The Thonnu

121 bytes

Rust, 34 bytes
|a,b|a.zip(b).map(|(i,j)|i.max(j))

which takes in two iterators over chars and returns another. This only works by shunting the following obscene type into the header code:
for<'a> fn(std::str::Chars<'a>, std::str::Chars<'a>) -> std::iter::Map<std::iter::Zip<std::str::Chars<'a>, std::str::Chars<'a>>, fn((char, char))->char>

Attempt This Online!
If iterators over chars do not count as reasonable input/output I can instead manage
60 bytes
|a,b|a.chars().zip(b.chars()).map(|(i,j)|i.max(j)).collect()

which has the much more reasonable type of
fn(&str, &str) -> String

Attempt This Online!

tinylisp 2, 28 bytes
(\(S T)(,(zip-with max S T)"

Try it at Replit! Example session:
tl2> (\(S T)(,(zip-with max S T)"
(() (S T) (, (zip-with max S T) ""))
tl2> (d F _
F
tl2> (F "hello," "world!")
"worlo,"

Explanation
The library functions zip-with and max do almost the entire task.* The only catch is that zip-with returns a list of codepoints, and we want a string. The easiest way to convert is to concatenate an empty string using , (short for concat).

* When I first answered this challenge, I had not yet implemented zip-with and max in the standard library. Here's my original 46-byte solution without those functions:
(\(S T)(,(m(p a(\(C D)(?(< C D)D C)))(z S T))"

Explanation:
(\(S T)(,(m(p a(\(C D)(?(< C D)D C)))(z S T))""))
(\                                              ) ; Lambda function
  (S T)                                           ; taking two strings S and T:
                                     (z S T)      ; Zip (-> list of pairs of codepoints)
         (m                                 )     ; Map to each pair:
           (p a                     )             ; Apply to its two items:
               (\                  )              ; Lambda function
                 (C D)                            ; taking two integers C and D:
                      (?(< C D)D C)               ; If C < D, then D, else C (i.e. max)
                                                  ; Now we have a list of codepoints...
       (,                                    "")  ; Concat "", converting to string

C#, 71, 67 bytes
saved a few bytes by using string.Join() instead of new string()
added 18 bytes to both versions for needing using System.Linq;
67 bytes
(a,b)=>string.Join("",(a.Zip(b,(x,y)=>x>y?x:y)));

71 bytes:
(a,b)=>new string(a.Zip(b,(x,y)=>x>y?x:y).ToArray());

DotNetFiddle

Charcoal, 17 bytes
Ｆ⌊⟦ＬθＬη⟧⌈⟦§θι§ηι⟧

Try it online! Link is to verbose version of code. Edit: Slice got added a few days later, which would have allowed the following code for 15 bytes: Try it online!
↑Ｅ✂θ⁰Ｌη¹⌈⟦ι§ηκ⟧

9 bytes instead of 15, not sure if I had this back in June so maybe it's valid lol :P https://tio.run/##S85ILErOT8z5/z8tv0hBI7UsMacssUhDqUpJRyG6UEchI1ZTUyGgKDOvRMM3sSIztzRXI1NT0/r//@zMvHSu/KSs1OSS/7pl/3WLcwA

Mathematica, 102 bytes
T=ToCharacterCode;L=Length;(a=T@#;b=T@#2;FromCharacterCode@Table[Max[a[[i]],b[[i]]],{i,L@a~Min~L@b}])&

input

["blended
", "bold"]

L@a~Min~L@b saves one byte

Modern Pascal
version 1 of algorithm (func:139bytes)
   for var l:=1 to min(length(paramstr(1)),length(paramstr(2))) do
      result+=iif(paramstr(1)[l]>paramstr(b)[l],paramstr(1)[l],paramstr(2)[l]);

Explanation
The for loop is designed to crawl to the length of the shortest string.
The output is compared appending to result the highest ASCII value of
each letter crawled. Since we are using shortest length, we can access
the strings elements directly - see v2 below, uses Copy() to be safer.
version 2 of algorithm (func:166bytes)
   for var l:=1 to max(length(paramstr(1)),length(paramstr(2))) do
      result+=iif(copy(paramstr(1),l,1)>copy(paramstr(2),l,1),copy(paramstr(1),l,1),copy(paramstr(2),l,1));

// Author of Modern Pascal

Welcome to our site! This contest is a [tag:code-golf] contest.  You should aim to minimize the number of bytes in the source code.  I don't know pascal at all so this may be well golfed already but I suspect there is some whitespace that can be removed.  Once you are satisfied with your golfs you can add the byte count of your program to your header.  If you have any questions you can ping me with @wheatwizard.

As Wheat Wizard said, I'm sure this can be golfed to reduce your score but I think that there is at least one typo in your first code, maybe two. Should iif(a[l]>b[l]),a[l] be if(a[l]>b[l],a[l]? (there is definitely an extra ) but I don't know about iif and if)

shortened. Good find on the extra paren. fixed. In MP, I added iff() to mimic ?(eval,true,false).

Micro, 119 bytes
{R b i m+:R}:X{R a i m+:R}:Y
""\\:a:b:R
{b:M}:N
a:M
b a<if(N,)
0:i{i1+:i
a i m C b i m C~:> if(X,Y)
i M=if(,Z)}:Z
Z
R:\

Perl 5 -lF, 88 67 bytes
@b=<>=~/./g;$#F=$#b=@F>@b?$#b:$#F;say map{($q=shift@b)gt$_?$q:$_}@F

Try it online!

Axiom, 67 20 bytes
f(a,b)==map(max,a,b)

And with this we now surpass JavaScript, Lisp until perhaps J and APL too.
The previous solution:
f(a,b)==concat[max(a.x,b.y)::String for x in 1..#a for y in 1..#b]

Common Lisp, 59 bytes
(lambda(x y)(map'string(lambda(a b)(if(char> a b)a b))x y))

Try it online!

Pip, 9 bytes
DQSS_MaZb

Try it online!
Pip doesn't have a string max operator, so I used SS (Sort String) instead:
      aZb  Zip the two cmdline args together, truncating to shorter length
     M     To that list of 2-element lists of characters, map a function:
  SS_       Sort each pair of characters stringwise
DQ          and dequeue the second (larger) one
           Autoprint the resulting list of characters

Acc!!, 186 bytes
N
Count i while _/128^i/32 {
_+128^(i+1)*N
}
_*128+N
Count i while _%128/32*(_/4096) {
Count j while _/128%128/(_%128+1) {
_/128^2*128^2+_/128%128+_%128*128
}
Write _%128
_/128^2*128+N
}

Input strings should be given on stdin, newline-separated. Try it online!
Explanation
We conceptually partition the accumulator into 7-bit registers, each of which can hold an input character. The first Count i loops until the input's ASCII code is smaller than 32, storing the first line of input into the accumulator, with the first character in the least-significant position:
, o l l e h
5 4 3 2 1 0
Accumulator value = asc(h) + 128*asc(e) + 128^2*asc(l) + ... = 1541853098728

Next, we shift everything left by one register, read the first character of the second line, and store it into register 0:
, o l l e h w
6 5 4 3 2 1 0

We Count i again while register 0 (_%128) and register 1 (_/128%128, though the formula can be golfed a bit in this context) are both >= 32. Inside the loop, we use a nested Count j loop to check if register 1 is strictly greater than register 0. (Comparisons are done via integer division: if a/(b+1) is 0, then a<=b; if a/(b+1) is nonzero, then a>b.) If it is greater, we swap the registers' contents. This loop executes at most once, because after swapping, the condition is guaranteed not to be true anymore.
After the (potential) swap, the larger of the two characters is in register 0, which we output. We then shift two registers to the right (_/128^2), shift one register back to the left (*128), and store the next input character in register 0 (+N):
, o l l e o
5 4 3 2 1 0

The Count i loop exits once one or both strings reach the newline at their end.

Whispers, 49 bytes
> Input
> Input
>> L»R
>> Each 3 1 2
>> Output 4

Try it online!
How it works
Each line consists of (line no.) (> or >>) (command) (the line numbers are implicitly added in the actual program)
1 > Input        - Retrieve the first input

2 > Input        - Retrieve the second input

3 >>  »          - Take the maximum of...
     L           -   the left argument and...
       R         -   the right argument

4 >> Each        - For each value in...
            1    -   the first line zipped with...
              2  -   the second input,
          3      -   call the third line

5 >>        4    - Run the fourth line, then...
     Output      - Output the result

Swift, 66 bytes
func f(a:String,b:String){print(String(zip(a,b).map{max($0,$1)}))}

Straight forward solution

Japt v2.0a0, 13 bytes
ÊmVl)îUcÈwVcY

Try it online!
Unpacked & How it works
Ul mVl)îUcXYZ{XwVcY

Ul      Length of 1st input (U)
mVl)    Minimum of above and length of 2nd input (V)
î       Take this length out of the following string...
UcXYZ{    Map on charcodes of U and convert back to string...
Xw          Maximum of this and...
VcY         V's charcode at the same index.

Japt doesn't have min/max on strings, but does have one on numbers. Turns out that it helped reduce bytes on both "Compute minimum length of two strings" and "Map on two strings to take higher chars".

Cjam, 3 bytes
This is so easy...
.e>

Pretty much the same as the Haskell answer, . takes an operator and performs "zipWith", and e> means take the max of the two inputs.
Try it online!

GolfScript, 23 bytes
~zip{.,({$1=}{;}if}%''+

Try it online!

R, 96 bytes
for(i in 1:min(lengths(m<-sapply(scan(,""),utf8ToInt))))cat(intToUtf8(max(m[[1]][i],m[[2]][i])))

Try it online!
Using ASCII code.

Erlang (escript), 46 bytes
t([I|M],[E|S])->[max(I,E)]++t(M,S);t(_,_)->[].

Try it online!
Explanation
t([I|M],[E|S])->               % Extract the head of both operands
[max(I,E)]                     % Take the max of the heads
++t(M,S);                      % Recurse with the remaining strings
t(_,_)                         % If head-extraction fails for either of these operands:
->[].                          % Return the empty string

Kotlin,  23  17 bytes
{zip(it,::maxOf)}

Try it online!

Burlesque, 9 bytes
lnp^q>]Z[

Try it online!
Returns a list of characters add 2 bytes for concat (\[)
ln  # Split on newlines
p^  # Push to arr
q>] # Boxed maximum
Z[  # ZipWith

Husk, 2 bytes
zY

Try it online!
zip using maximum.

Vyxal, 3 bytes
ZvG

Try it Online!
That is: the maximum function (G) vectorised over the inputs Zipped together (abc and def turn into [["a", "d"], ["b", "e"], ["c", "f"]]. Takes a single string (alternatively, a list of characters) and outputs a list of characters.

Funnily enough, this is a one-to-one correspondence to 05AB1E: Z → ø, v → €, and G → à. (See my answer below.)

05AB1E, 3 bytes
ø€à

Try it online!
ø€à  # full program
ø    # list of...
  à  # maximums of...
 €   # each element of...
ø    # code points of...
     # implicit input...
ø    # with each element paired with the corresponding element in second sub-list
     # implicit output

Factor, 16 4 bytes
vmax

Try it online!
Element-wise maximum. It's a builtin.

Pyth, 5 bytes
eCSMC

Test suite

Thunno J B, \$ 5 \log_{256}(96) \approx \$ 4.12 bytes
ZZeMC

(No ATO link since it's not on a new enough version)
Explanation
ZZeMC  # Implicit input. The B flag converts the strings to codepoints.
ZZe    # Zip together and loop through:
   M   #   Get the maximum
    C  #   And get chr of that
       # Implicit output, with the J flag joining everything together

Thunno J, \$ 9 \log_{256}(96) \approx \$ 7.41 bytes
ZZeO.AJMC

(No ATO link since it's not on a new enough version)
Explanation
Unfortunately the max command (M) doesn't work with strings, otherwise this would have been a lot simpler.
ZZeO.AJMC  # Implicit input
ZZe        # Zip together and loop through:
   O.AJ    #   Get the ordinals of both characters
       M   #   Get the maximum
        C  #   And get chr of that
           # Implicit output, with the J flag joining everything together

Screenshots

Python 3, 26 bytes
lambda*a:list(map(max,*a))

Try it online!
Similar to another Python 3 answer, only that I use list instead of ''.join, which shaves 3 bytes off.

[*map(...)] saves some over list

C (gcc), 51 bytes
f(char*s,char*t){(*s=*s>*t|!*s?*s:*t)&&f(s+1,t+1);}

Try it online!
C (gcc), 51 bytes
f(char*s,char*t){(*s=0u-*s<-*t?*s:*t)&&f(s+1,t+1);}

Try it online!

Arturo, 22 bytes
$=>[couple&&|map=>max]

Try it
Takes and outputs a list of characters.

Thunno 2, 3 bytes
Z€G

Output as a list of characters. Add the J flag if you want a string.
Explanation
Z€G  # Implicit input
Z    # Zip the two inputs together
 €   # For each pair:
  G  #  Get the maximum of the pair
     # Implicit output

Screenshot

Does this work for inputs of different lengths?

@cairdcoinheringaahing yes it does: https://i.stack.imgur.com/2RBi7.png

source: Stack Exchange

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

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

sort: votes


text:
Regex that matches everything but itself
You must make a regex that matches everything except itself. For example, PPCG must not match PPCG, but must match everything else, like something, PPC,  and PPCG!.
Surrounding slashes are not considered part of the regex in flavors where they are usually part of the syntax. The same is true of all delimiters.
The regex needs to match the entire string, not just a substring.
You may choose your flavor, but you can't use a flavor newer than this challenge. Please pick a flavor that is easily tested.
Shortest regex in bytes wins.
(Sandbox (deleted))

Related

Also, jimmy's solution to the previous challenge can be inverted quite trivially to make a valid answer for this one.

I love how you pointed out a related question on your own question.

@carusocomputing Why wouldn't they? The point of related links is to make the challenges show up in each others' sidebars.

@MartinEnder would assume one would put it in the post itself, not as a comment is all I was saying ;).

Can we use any flags?

Is it acceptable if it matches a substring of itself, but not the entire string?

@jimmy23013 flags: yes substring: no

@programmer5000 I mean, it matches entire strings for all other strings, as specified, but only match a substring of itself.

PCRE flavour, 45 bytes
^(?!\^()(?R){2}\z)|\1\Q(?!\^()(?R){2}\z)|\1\Q

Try it at regex101.
This is a simple modification of jimmy23013's brilliant solution to the opposite challenge. We just need to make two changes:

In this challenges, the delimiters shouldn't be matched so we drop them from the regex as well. However, that could lead to infinite recursion, because then no characters would be matched before the (?R) call. To fix this, we match the ^ explicitly with \^ to have one character before we enter the recursion.
We need to negate the result which is as simple as wrapping everything after the ^ in a negative lookahead to ensure that the input isn't equal to the string.

For the details of this quining approach, see jimmy's amazing answer.

Even though it's a modification of that other answer I wouldn't have had a clue about how to do it so +1

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


text:
Solve a game of flood
This challenge was inspired by the game Flood.
Challenge
Given a grid of colors, determine the optimal list of moves to take to convert the whole grid to the same color.
First of all, let us say that a pixel is in the "top left chunk" if and only if it is either the top left pixel or it shares an edge with a pixel of the same color in the top left chunk. Then, a move is defined as changing the color of all pixels in the top left chunk to a specific color.
If you change the color of the top left chunk to match the color of one of the pixels adjacent to the top left chunk, then that pixel joins the top left chunk.
The input will be given as a matrix of positive integers with each integer representing a distinct color. A move is defined by the color to which you change the top left chunk; thus, a move is represented as an integer,
The output should be a list of integers representing which moves to take to convert the entire grid to one color in as few moves as possible. If multiple methods are possible, outputting all of them or any one of them is allowed.
Example
Let's take this as an example:
123
132
223

In this case, both [2, 3, 2] and [3, 2, 3] work. We observe the following for [2, 3, 2]:
123    223    333    222
132 -> 232 -> 332 -> 222
223    223    333    222

and the following for [3, 2, 3]:
123    323    223    333
132 -> 332 -> 222 -> 333
223    223    223    333

Test Cases
123
132 -> 2 3 2 OR 3 2 3
223

111
111 -> []
111

123
231 -> 2 3 1 2
312

123
312 -> 2 1 3 1 2 OR 2 1 3 2 1 OR 2 3 2 1 3 OR 2 3 2 3 1 OR 3 1 2 1 3 OR 3 1 2 3 1 OR 3 2 3 1 2 OR 3 2 3 2 1 (Thanks @JonathanAllan)
231

Rules

This is code-golf so the shortest valid submission is determined as the winner, tiebreak by earlier submission winning
The input and output can be in any reasonable format for matrices and lists
The input is not necessarily square but is necessarily rectangular
Your program must be able to handle at least 128 x 128
Your program must be able to handle at least 16384 colors
You may also take the number of distinct colors as an input

Please correct my test cases if they are wrong. Thanks!
Note:
I believe that this is different enough from Create A Flood AI to warrant its own post because the winning criteria are very different; that one mainly asks to find a small number of steps to solve all of the test cases; this one requires one of the shortest solutions and is a code-golf. However, if you disagree, please close-vote as duplicate and then the community can decide.

Related

@rahnema1 Oh that's what it's called. Interesting, thanks.

Any limit on the size of the matrix? Any limit on the number of distinct 'colors'? Also, can we take the number of colors as an additional input or are we supposed to figure this out by scanning the matrix?

@Arnauld Preferably not, but if your program can handle 128x128 then that's fine as well. That also means you can have an upper bound of 16384 colors because it's impossible to have more than m x n colors. Also, preferable you're supposed to scan the matrix but for the purposes of this challenge I will say that you may also take the number of colors as an input.

I believe the complete list for the shortest solutions to the last test case are 21312, 21321, 23213, 23231, 31213, 31231, 32312, 32321 (by hand).

Near duplicate

@user1502040 I think it's close enough to be an actual duplicate. Thanks for finding that post!

@user1502040 On second thought, that one asks to find the shortest solutions for a lot of grids; this one wants the shortest code to get it, so the winning criteria are a bit different. Thanks anyway :)

Right, I think this challenge is looking for a perfect brute force solution, whereas that one is looking for the best possible solution that's capable of running in practice.

CJam (77 bytes)
{Ma+a{():B;:A:|{A((:C;0\+a\+_e_,2*{[0C]f/[0_]f*z}*{0Der}%BD+a+a+}fDAe_(-}g;B}

Online demo. This is an anonymous block (function) which takes the input as a 2D array and provides the output as a 1D array.


text:
Puzzle & Golf : Reproduce this gif
The objective of this programming puzzle is to reproduce the following gif.

Simplification: If you notice the geometric figures don't exactly touch each other. I think it's simpler if you make each vertex to touch the respective edge, and not to go beyond it. I'm not sure though of how this will alter the configuration of the balls movement.
Specifications: Sizes, colours, etc. Make them to your heart's content. But let's just be reasonable. I would prefer if the velocity of the balls was slower than that in the gif.
For those who are having a harder time understanding the picture, we begin with a triangle (3 sides), then a square(4sides), then a pentagon(5sides), and so on... until an pentadecagon (15 sides).
Wining condition: Smallest solution wins.
Berserker Mode: Do the gif by adding a third dimension...

Can you include the gif/example image into the post. I shouldn't have to go to a third party site to know what I should be doing. Also what does Berserker Mode: Do the gif by adding a third dimension... mean? Can you add some specifics, size, colour, radius of each "circle", speed of the dots, how many sides each "circle" has etc?

The biggest problem is that the winning condition is unclear. You could fix that by adding a [tag:code-golf] tag so that the shortest solution wins. In this case the berserker mode could grant a bonus to the byte count, but I think  it would be better to keep it for another challenge.

VTC as unclear because, as it stands, it lacks any sepcifications for the individual elements. Tip: Throw this into the Sandbox and people will help you flesh it out.

@TheLethalCoder done the gif.


text:
Climb a step to a prime
The title of Numberphile's newest video, 13532385396179, is a fixed point of the following function \$f\$ on the positive integers:

Let \$n\$ be a positive integer. Write the prime factorization in the usual way, e.g. \$60 = 2^2 \cdot 3 \cdot 5\$, in which the primes are written in increasing order, and exponents of 1 are omitted. Then bring exponents down to the line and omit all multiplication signs, obtaining a number \$f(n)\$. [...] for example, \$f(60) = f(2^2 \cdot 3 \cdot 5) = 2235\$.

(The above definition is taken from Problem 5 of Five $1,000 Problems - John H. Conway)
Note that \$f(13532385396179) = f(13 \cdot 53^2 \cdot 3853 \cdot 96179) = 13532385396179\$.
Task
Take a positive composite integer \$n\$ as input, and output \$f(n)\$.
Another example
\$48 = 2^4 \cdot 3\$, so \$f (48) = 243\$.
Testcases
More testcases are available here.
   4 -> 22
   6 -> 23
   8 -> 23
  48 -> 243
  52 -> 2213
  60 -> 2235
 999 -> 3337
9999 -> 3211101

+1 I'm still astonished that someone managed to find 13532385396179 as a disproof of the conjecture.  I guess the $1000 prize would go some way to pay for the electricity used! :)

Without following the link it wasn't clear that the conjecture is that repeated applications of f(n) will always reach a prime (and of course f(p) = p if p is prime). 13532385396179 disproves the conjecture because it's both composite and a fixed opint.

Python, 166 162 159 bytes
You guys are much better. This is what I used! (the algorithm that solved it calls this)
from primefac import*
def c(n):
 x=factorint(n)
 a=''
 for i in range(len(x)):
  l=min(x.keys())
  a+=str(l)
  if x[l]>1:a+=str(x[l])
  x.pop(l)
 return int(a)

Please include the language and number of bytes. 2. Please attempt to golf down your program (reduce the number of bytes) by for example using single-letter variables. 3. Please include the import statements (factorint is obviously not a built-in function).

Why did someone downvote a newcomer instead of helping him improve his answer as @LeakyNun did? :(

Sorry- that really is what I used (I found the number).  I just thought the crummy code would be funny. You can take it down.

Welcome on the site. It's really nice to have you sharing with us your solution. (for people who don't know, Jim Davis is the one who solved this problem in the first place). However, answers to challenges need to follow some rules. If you just follow the suggestions from @LeakyNun, then you answer will be valid. (maybe have a look at the other answers to see how they usually look like)

I edited in a golfed version. I do not know Python, so if I introduced syntax errors, please let me know :)

Thanks Stephen!  I didn't mean to be rude and couldn't figure out how to delete the post.

Oh my God, I didn't expect Jim Davis himself to appear in this site, and to answer my challenge... I feel so honoured now...

@JimDavis No problem, honestly I think we were being rude. We have fairly high standards for what is "valid".

No, not at all.  I didn't bother to learn the syntax to post or anything.  All these little six bit programs look like magic!  And I appreciate you being nice to somebody who is a troll for all you know.

ehh, not a troll by the way.  My email address is on http://gladhoboexpress.blogspot.ca/2014/10/climb-to-prime.html ... I left the post up, nobody swamps you with email over math.

You can remove the space before the asterisk, the 0, in range (range(0, x) == range(x)), that saves 3 bytes, together. If this is Python 2, you can also replace calls to str with repr notation, e.g. `l`, which would save you another 6 bytes :)

It's extremely cool that you've posted a program, but importing a non-standard module is stretching things a little. ;) OTOH, the really tiny answers on this site come from golfing languages that have all sorts of crazy functions built in...

Would a=0 work to save a byte?

And by the way, it is against the policy of PPCG to edit a golf into another author's post, so feel free to rollback the edits if you wish.

Jelly, 6 bytes
ÆFFḟ1V

Try it online!
Explanation
ÆF      Get prime factorisation of input as prime-exponent pairs.
  F     Flatten.
   ḟ1   Remove 1s.
     V  Effectively flattens the list into a single integer.

V = "concatenate to a single string and eval as Jelly"

@EriktheOutgolfer Yes, hence "effectively".

@MartinEnder Any particular reason you don't use Ḍ (Convert from decimal to integer)?

@Christian Because the list might contain multi-digit integers.

@MartinEnder Ah, clever. I've used FḌ in the past - that's a good tip!

Brachylog, 8 bytes
ḋoọc;1xc

Try it online!
Explanation
Example input: 60

ḋ          Prime decomposition: [5,3,2,2]
 o         Order: [2,2,3,5]
  ọ        Occurences: [[2,2],[3,1],[5,1]]
   c       Concatenate: [2,2,3,1,5,1]
    ;1x    Execute 1s: [2,2,3,5]
       c   Concatenate: 2235

You can use ℕ₂ˢ (select all integers greater than or equal to 2) instead of ;1x, which is probably more readable and more in the spirit of Brachylog.

Mathics, 34 bytes
Row[Join@@FactorInteger@#/.1->""]&

Try it online!
-2 bytes from @sanchez

DeleteCases is long, you can use /.1->"" or /.1->##&[] (alternative form of /.1->Nothing

@user202729 All of those need a space in front of the 1 to prevent it from parsing as ... / (0.1).

You are right! fixed

Using Join, i.e. Row[Join@@FactorInteger@#/.1->""]& results in 34 bytes

05AB1E, 10 bytes
Òγʒ¬?gDië?

Try it online!
Ò          # Push list of prime factors with duplicates
 γ         # Break into chunks of consecutive elements
  ʒ        # For each
   ¬?      #   Print the first element
     gD    #   Push the length of this chunk twice
       ië  #   If not 1
         ? #     Print the length

CJam, 8 bytes
limF:~1-

Try it online!
Explanation
li  e# Read input and convert to integer.
mF  e# Get prime factorisation as prime-exponent pairs.
:~  e# Flatten.
1-  e# Remove 1s.
    e# Implicitly print a flattened representation of the list.

I would have used e_ to flatten, since that's what it's there for, but it doesn't change the score.

@PeterTaylor Hm yeah, I can never decide which one to use, but tend to go with e_ for deep flatten only and use :~ whenever it's just a single level.

05AB1E, 12 11 bytes
Òγvy¬sgD≠×J

Try it online!
Explanation
Ò            # calculate prime factors with duplicates
 γ           # group consecutive equal elements
  vy         # for each group
    ¬        # get the head without popping
     sg      # push the length of the group
       D≠×   # repeat the length (length != 1) times
          J  # join

Fails for 48.

Python 2, 99 bytes
n=input()
r=''
p=2
while~-n:
 e=0
 while n%p<1:e+=1;n/=p
 r+=str(p)*(e>0)+str(e)*(e>1);p+=1
print r

Try it online!
If inputs are restricted to be below 2147483659, both str(...) may be replaced by `...` saving 6 bytes (this program will be very slow for numbers affected anyway!).

Ohm, 11 bytes
o:_]D2<?O;J

Try it online!
Explanation
o:_]D2<?O;J
o           # Push prime factors with powers from input (Format [[prime,power],...]
 :          # For each...
  _          # Push current element
   ]         # flatten
    D        # Duplicate power
     2<? ;   # Is the power smaller than 2?
        O     # Delete top of stacks
          J  # Join

Pyth, 12 bytes
smjk_>hddr8P

Try it!
alternative, 12 bytes
smjk<_AdGr8P

Try that!
explanation
smjk_>hddr8P
           PQ  # prime factorization (already in correct order) of the implicit input: [3, 3, 11, 101]
         r8    # length encode: [[2, 3], [1, 11], [1, 101]]
 m             # map over the length encoded list (lambda variable: d)
     >hdd      # take the d[0] last elements of d (so only the last for d[0]==1 and all else)
    _          # reverse that list
  jk           # join into a string
s              # conatenate the list of strings

Pyth, 11 bytes
jksm_-d1r8P

Try here

PHP, 88 bytes
for($i=2;1<$a=&$argn;)$a%$i?$i++:$a/=$i+!++$r[$i];foreach($r as$k=>$v)echo$k,$v<2?"":$v;

Try it online!

Japt, 19 bytes
k ó¥ ®¯1 pZlÃc fÉ q

Test it online!
Explanation
 k ó¥  ®   ¯  1 pZlÃ c fÉ  q
Uk ó== mZ{Zs0,1 pZl} c f-1 q  // Ungolfed
                              // Implicit: U = input number
Uk                            // Break U into its prime factors.
   ó==                        // Group into runs of equal items.
       mZ{         }          // Map each item Z in this to
          Zs0,1               //   Z.slice(0, 1) (the array of the first item),
                pZl           //   with Z.length added at the end.
                              // This returns an array of prime-exponent pairs (Jelly's ÆF).
                     c        // Flatten.
                       f-1    // Filter to the items X where X - 1 is truthy (removes '1's).
                           q  // Join the resulting array into a single string.
                              // Implicit: output result of last expression

R, 72 bytes
x=rle(pracma::factors(scan()));x$l[x$l<2]='';paste0(x$v,x$l,collapse='')

Requires the pracma package, which is not installed on TIO.

APL (Dyalog Extended), 15 14 bytes
Saved 1 byte thanks to @Adám
∊⍕¨1~⍨∊⍉2⌂pco⎕

Try it online!
∊⍕¨1~⍨∊⍉2⌂pco⎕
               ⎕      ⍝ Input
          2⌂pco        ⍝ Prime factors with exponents
        ⍉             ⍝ Transpose so the 1st column is factors, 2nd is exponents
       ∊               ⍝ Flatten
    1~⍨               ⍝ Remove 1
 ⍕¨                   ⍝ Convert each to a string
∊                      ⍝ Concatenate them together

Javascript - 91 bytes
(x,r='',i=1,n)=>{while(x>i++){for(n=0;x%i<1;n++)x/=i;r+=(n>0?i+'':'')+(n>1?n:'')}return r}

Explanation
(x,r='',i=1,n)=>(          // input x is the number to process, r, i, n are default values only
    while(x>i++){          // iterate over i until x
        for(n=0;x%i<1;n++) // iterate over n until i is not a factor of x
            x/=i;          // factor i out of x
        r+=(n>0?i+'':'')   // append i to r if n > 0
            +(n>1?n:'')    // append n to r if n > 1
                           // i+'' prevents adding i and n before appending to r
    }
    return r               // return r by comma-operator and arrow function syntax
)

Java 8, 103 chars
Pretty straightforward solution.
n->{String r="";int d=2,c;while(n>1){c=0;while(n%d<1){c++;n/=d;}if(c>0)r+=d;if(c>1)r+=c;d++;}return r;}

Ungolfed:
private static Function<Integer, String> f = n->{
    String result = "";
    int divisor = 2, count;
    while (n>1) {
        count = 0;
        while (n % divisor < 1) {
            count++;
            n /= divisor;
        }
        if (count > 0) result += divisor;
        if (count > 1) result += count;
        divisor++;
    }
    return result;
};

91 bytes

Octave, 69 bytes
@(a)printf('%d',(f=[[~,c]=hist(b=factor(a),d=unique(b));d](:))(f~=1))

Try it online!
Ended up being quite long, but this will generate the desired output.
Essentially we use the histogram function to count the number of occurrences of the unique values in the prime factorisation of the input value.

The result of the factor() function gives the prime factors in ascending order
we then find unique() values in that array
hist() returns the number of occurrences

Once we have the two arrays (one for unique factors, one for counts), we concatenate the arrays vertically (one on top of the other), and then flatten. This interleaves the factors with counts.
Finally we display the result as a string ensuring to skip any 1's in the final array. The only time 1's can appear is if the count was 1 because 1 will never be a prime factor. This elimination is done before converting to a string so it won't affect things like the number 10.

Ruby, 45 + 7 bytes
Requires the flag -rprime.
->n{(n.prime_division.flatten-[1]).join.to_i}

Try it online!

Pyth - 16 bytes
V{PQpNK/PQNItKpK

Try it
Another solution:
sm`d-.nm(d/PQd){PQ1

One can replace FN by V.

Also, r8 (run-length encoding) seems to be useful.

C#, 206 100 bytes
n=>{var r="";for(int d=1,c;++d<=n;){c=0;while(n%d<1){c++;n/=d;}r+=c>0?d+(c>1?c+"":""):"";}return r;}

Full/Formatted version:
using System;

class P
{
    static void Main()
    {
        Func<int, string> func = n =>
        {
            var r = "";
            for (int d = 1, c; ++d <= n;)
            {
                c = 0;
                while (n % d < 1)
                {
                    c++;
                    n /= d;
                }

                r += c > 0 ? d + (c > 1 ? c + "" : "") : "";
            }

            return r;
        };

        Console.WriteLine(func(4));
        Console.WriteLine(func(6));
        Console.WriteLine(func(8));
        Console.WriteLine(func(48));
        Console.WriteLine(func(52));
        Console.WriteLine(func(60));
        Console.WriteLine(func(999));
        Console.WriteLine(func(9999));

        Console.ReadLine();
    }
}

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


text:
Rate my sorting
Introduction
So my boss is making me do some manual labor...urgh...I have to take a part out a box of parts, process it and put it back in the box. To make this more interesting I try to sort the parts as I do this, as each part has a unique alphanumeric serial number.
Unfortunately, I only have room to have four parts out the box at a time and I'm not taking each part out of the box more than once (that'd be even more work!) so my sorting capabilities are limited.
Challenge
Your challenge is to write a full program or function that rates my sorting of a given box of parts.
The Sorting Process

Take 4 parts out of the box
Take the part that comes first by serial number
Process the part
Put the part back in the box
Take another part out of the box (if there are any left)
Repeat steps 2-6 until all parts are processed (moved only once).

Input
A set of serial numbers in the format [A-Z][A-Z][0-9][0-9][0-9]
Input can be an array/list or deliminated string, python example...
['DT064', 'SW938', 'LB439', 'KG338', 'ZW753', 'FL170', 'QW374', 'GJ697', 'CX284', 'YW017']

Output:
The score of the sorted/processed box (see scoring below)
Scoring
For each part note how far away it is from where it would be in a perfectly sorted box. The score is the total of this value for all parts in the box.
Examples/Test cases
input          ['AA111', 'AA222', 'AA333', 'AA444', 'AA000', 'AA555']
my sorted list ['AA111', 'AA000', 'AA222', 'AA333', 'AA444', 'AA555'] (no need to output)
perfect sort   ['AA000', 'AA111', 'AA222', 'AA333', 'AA444', 'AA555'] (no need to output)
output         2 (because first two elements are out of sequence by 1 position each)

input          ['GF836', 'DL482', 'XZ908', 'KG103', 'PY897', 'EY613', 'JX087', 'XA056', 'HR936', 'LK200']
my sorted list ['DL482', 'GF836', 'EY613', 'JX087', 'KG103', 'HR936', 'LK200', 'PY897', 'XA056', 'XZ908']
perfect sort   ['DL482', 'EY613', 'GF836', 'HR936', 'JX087', 'KG103', 'LK200', 'PY897', 'XA056', 'XZ908']
output         6

input  ['UL963', 'PJ134', 'AY976', 'RG701', 'AU214', 'HM923', 'TE820', 'RP893', 'CC037', 'VK701']
output 8

input  ['DE578', 'BA476', 'TP241', 'RU293', 'NQ369', 'YE849', 'KS028', 'KX960', 'OU752', 'OQ570']
output 6

input  ['BZ606', 'LJ644', 'VJ078', 'IK737', 'JR979', 'TY181', 'RJ990', 'ZQ302', 'AH702', 'EL539']
output 18

I have an example solution (ungolfed) in Python 3 if needed.

How does AA000 come after AA111?

Also, you said that the score is the sum of the distances. Wouldn't that make the first example's output significantly greater than 2?

@LeakyNun in the first example AA000 didn't come out the box until the second iteration so the best position it could achieve is second in the sorted box. I've added a bit more explanation to the test case.

Can you please post 1 or 2 examples of "my sorted lists" in the test cases?

@Jenny_mathy I've added a second expanded test case for you.

@Notts90 thank you.my answer is ready

05AB1E, 28 25 24 23 bytes
-5 bytes thanks to Emigna
gÍG4ôć{ćˆì˜}¯ì©{vXykNαO

Try it online!
Explanation
gÍG4ôć{ćˆì˜}¯ì©{vXykNαO   Argument l
gÍG        }              len(l)-3 times do:
   4ô                       Split into pieces of 4
     ć                      Extract head
      {                     Sort
       ćˆ                   Extract head and add to global array
         ì˜                 Put rest of array back together
            ¯ì            Prepend global array to leftover elements
              ©           Store in register_c without popping
               {          Sort
                v         For y in sorted array, do:
                 ®yk        Index of y in register_c
                    Nα      Absolute difference with iteration index
                      O     Total sum of index differences

Haven't really checked the challenge, but you could save 3 bytes like this: gÍG4ôć{ćˆì˜}¯ìUI{vXykNα}O.

@Emigna Thanks I didn't know arrays could be stored in X. I will update it

Actually the final } could be omitted as well.

In total 5 bytes saved as gÍG4ôć{ćˆì˜}¯ì©{v®ykNαO. Using the register and sorting the final list instead of input (as they contain the same items anyways)

@Emigna I was sure the last part could be optimised, thanks!

JavaScript (ES6), 104 bytes
a=>a.reduce(p=>(j=i-[...a].sort().indexOf(a[a.splice(i,4,...a.slice(i,i+4).sort()),i++]))>0?p+j:p-j,i=0)

Test cases

let f =

a=>a.reduce(p=>(j=i-[...a].sort().indexOf(a[a.splice(i,4,...a.slice(i,i+4).sort()),i++]))>0?p+j:p-j,i=0)

console.log(f(['AA111', 'AA222', 'AA333', 'AA444', 'AA000', 'AA555']))
console.log(f(['GF836', 'DL482', 'XZ908', 'KG103', 'PY897', 'EY613', 'JX087', 'XA056', 'HR936', 'LK200']))
console.log(f(['UL963', 'PJ134', 'AY976', 'RG701', 'AU214', 'HM923', 'TE820', 'RP893', 'CC037', 'VK701']))
console.log(f(['DE578', 'BA476', 'TP241', 'RU293', 'NQ369', 'YE849', 'KS028', 'KX960', 'OU752', 'OQ570']))
console.log(f(['BZ606', 'LJ644', 'VJ078', 'IK737', 'JR979', 'TY181', 'RJ990', 'ZQ302', 'AH702', 'EL539']))

I now see that my use of shift led me down a dead end, although I still would only have ended up with a 105-byte answer at best, since I wouldn't have used the i=0 trick either.

JavaScript (ES6), 115 113 bytes
a=>a.reduce((r,_,i)=>r+=(i-=[...a].sort().indexOf((b=b.splice(0,4).sort().concat(b)).shift()))<0?-i:i,0,b=[...a])

PHP, 132 bytes
<?for($d=4+count($p=$g=$_GET),sort($p);--$d;rsort($n),$i<4?:$r+=abs($k++-array_flip($p)[array_pop($n)]))$d<4?:$n[]=$g[+$i++];echo$r;

Try it online!
PHP, 136 bytes
<?for($n=array_slice($p=$g=$_GET,0,$i=3),sort($p);$n;rsort($n),$r+=abs($k++-array_flip($p)[array_pop($n)]))$g[$i]&&$n[]=$g[$i++];echo$r;

Try it online!

Mathematica, 173 bytes
A={};(V=Sort[S=#];While[Length@S>4,T=Take[Sort@S[[;;4]],1][[1]];A~AppendTo~T;S=S~DeleteCases~T];Tr@Table[Abs[i-Flatten[Position[Join[A,Sort@S],V[[i]]]][[1]]],{i,Length@V}])&

input

[{BZ606, LJ644, VJ078, IK737, JR979, TY181, RJ990, ZQ302, AH702,
    EL539}]

output

18


text:
The weird and wild bean game
Maybe some of you already know this game: you have a collection of jelly beans of different colors. For every color, the bean can have different tastes, some are good and some are bad, and you cannot tell them apart. You have to pick a bean of a given color, and pray you have select a good one.
So, write the shortest program that receives a color of your choice (from a given list), and randomly returns the taste selected. The taste has to be picked from a built-in list. The possible list of inputs and outputs are:
Input      Output choices [only one from the list]
--------------------------------------------------
green      lawn clippings, lime, mucus, pear
yellow     rotten eggs, buttered popcorn
blue       toothpaste, blue berry
orange     vomit, peach
brown      canned dog food, chocolate
white      stinky socks, tutti-frutti, baby diapers, coconut

Rules:

You can assume that the input is going to be always a color from the input choices.
Case and trailing spaces and/or newlines do not matter.
Output must be uniformly random: succesive program executions must yield different results, and the chances of getting a given taste must be the same for all tastes in a list.

This is code-golf, so may the shortest program win!

In one part of your question, you state that the taste will be selected from a given list, implying that we will receive it as input. However, in your examples, it seems the opposite is so.

@Okx sorry, is it better now? I'm still getting used to posting here...

Maybe state that the output must be uniformly random so that all possible outputs have the same odds of appearing or else I can just add 2 options from each list.

@StefanDelport thank you, fixed!

It's a bit late now, but it should probably have been blueberry not blue berry.

C#, 418 313 305 271 bytes
s=>{var a="lawn clippings,lime,mucus,pear|rotten eggs,buttered popcorn|toothpaste,blue berry|vomit,peach|canned dog food,chocolate|stinky socks,tutti-frutti,baby diapers,coconut".Split('|')["eluaoi".IndexOf(s[2])].Split(',');return a[new System.Random().Next(a.Length)];}

Too long even for C# but I can't see how to get it any shorter.
Full/Formatted version:
using System;

class P
{
    static void Main()
    {
        Func<string, string> f = s =>
        {
            var a = "lawn clippings,lime,mucus,pear|rotten eggs,buttered popcorn|toothpaste,blue berry|vomit,peach|canned dog food,chocolate|stinky socks,tutti-frutti,baby diapers,coconut"
                    .Split('|')["eluaoi".IndexOf(s[2])].Split(',');

            return a[new System.Random().Next(a.Length)];
        };

        Console.WriteLine(f("green"));
        Console.WriteLine(f("yellow"));
        Console.WriteLine(f("blue"));
        Console.WriteLine(f("orange"));
        Console.WriteLine(f("brown"));
        Console.WriteLine(f("white"));

        Console.ReadLine();
    }
}

That's a hell of a golf! +1

@Shaggy Thanks :) I started off doing it a really naive way and slowly realised the shorter way of doing things. I had it stuck in my head I'd need a dictionary and then saw your answer using the string and splitting and realised the path to the light!

JavaScript (ES6), 235 bytes
I need to figure out how to compress strings in JS!
c=>(a="lawn clippings,lime,mucus,pear|rotten eggs,buttered popcorn|toothpaste,blue berry|vomit,peach|canned dog food,chocolate|stinky socks,tutti-frutti,baby diapers,coconut".split`|`["eluaoi".search(c[2])].split`,`)[new Date%a.length]

If that's not "random enough" for your tastes then add 7 bytes replacing new Date with Math.random().
c=>(a="lawn clippings,lime,mucus,pear|rotten eggs,buttered popcorn|toothpaste,blue berry|vomit,peach|canned dog food,chocolate|stinky socks,tutti-frutti,baby diapers,coconut".split`|`["eluaoi".search(c[2])].split`,`)[Math.random()*a.length|0]

Try it

f=
c=>(a="lawn clippings,lime,mucus,pear|rotten eggs,buttered popcorn|toothpaste,blue berry|vomit,peach|canned dog food,chocolate|stinky socks,tutti-frutti,baby diapers,coconut".split`|`["eluaoi".search(c[2])].split`,`)[Math.random()*a.length|0]

r=(d=document).createElement("input");r.name="i";r.type="radio";l=d.createElement("label");j="Kiwi,sour_lemon,berryBlue,OrangeSherbet,rootBeer,Coconut".split`,`;for(s in e="green,yellow,blue,orange,brown,white".split`,`){r=r.cloneNode();l=l.cloneNode();l.setAttribute("for",r.id=r.value=e[s]);l.style.backgroundImage=`url(https://cdn-tp1.mozu.com/9046-11441/cms//files/${j[s]}.jpg)`;g.prepend(r,l);}onchange=_=>o.innerText=(v=(i=d.querySelector(":checked")).value)+": "+f(v,i.checked=0)
body{align-items:center;background:#eee;display:flex;flex-wrap:wrap;height:100vh;justify-content:center;margin:0;text-align:center;}#g{background:#fff;box-shadow:5px 5px 5px #ccc;padding:10px;}input{display:none;}label{background-repeat:no-repeat;background-size:contain;cursor:pointer;display:inline-block;height:64px;margin:10px;width:75px;}#o{font-family:monospace;font-size:18px;margin:10px auto;text-align:center;width:100%;}

click a jelly bean

Nice idea with eluaoi, I thought of it by myself and thought, "Oooh look how clever I'm being" then saw you beat me to it!

new Date%a.length isn't "uniformly random".

Thanks, @TheLethalCoder - I was that lazy, I nearly didn't bother checking for uniqueness past the 2nd characters!

Heh, I think about 4 or 5 of us came up with eluaoi around the same time :P

@OlivierGrégoire, this solution predates that requirement but I've added another option that uses Math.random instead.

05AB1E, 126 bytes
¨¤.•4Õ!Õ•.•QCQΓ^ïTÁÕ#HвΘÊÓΘñ…~çÌùY$J*shÉÉk‹Ú&žвZÍζö<^'¢βŽÚq¡eζd`Ãó¨₅γ!i"v_Ym¤ÓδVË5¥vÅ¼QÐ‰øΣγ9∞\L‰,ǝ¦8VÜUт:x+sм•'x'-:'q¡'j¡€.R‡

Explanation:
¨¤                              Get the second to last character of the string
  .•4Õ!Õ•                       Compressed string: "eougwt"
         .• .. •                Compressed base-27 string
                'x'-:           Replace "x" with "-" (for tutti-frutti)
                     'q¡        Split on 'q'
                        'j¡     Split each on 'j'
                           €    For each...
                             .R  Select a random element
                               ‡ Transliterate

If anyone's wondering, here's the uncompressed string:
lawn clippingsjlimejmucusjpearqrotten eggsjbuttered popcornqtoothpastejblue berryqvomitjpeachqcanned dog foodjchocolateqstinky socksjtuttixfruttijbaby diapersjcoconut

I can probably compress it more using some clever tricks and the dictionary, though.
Try it online!

You can compress "eougwt" to .•4Õ!Õ• for -1.

@EriktheOutgolfer When I tried that, I was comparing the length of eougwt and .•4Õ!Õ•, instead of "eougwt" and .•4Õ!Õ•. Oops.

Jelly, 101 100 bytes
3ị“©ȷ#Ȧ-»iị“'æLṬẏeṃɼẹ-N0ṁH)A“¬ɗ-ṃȥḞ“I$aṇṾjð4“£Ʋṛ÷pḶƥƑL]p“÷Hnøgİỵ£@ḥEḶƑƤi÷Ḃ\oŻẆ#ụqU½b“ḥĠḄĿĖṇ⁻Œḳ-¬"»ỴX

Try it online!

Jelly,  95  94 bytes
OḄị“÷Hnøgİỵ£@ḥEḶƑƤi÷Ḃ\oŻẆ#ụqU½b““¬ɗ-ṃȥḞ“'æLṬẏeṃɼẹ-N0ṁH)A“ḥĠḄĿĖṇ⁻Œḳ-¬"““I$aṇṾjð4“£Ʋṛ÷pḶƥƑL]p»ỴX

A monadic link accepting a list of (lowercase) characters and returning a list of characters.
Try it online! or eat a packet of 48.
How?
Eighty-nine of the ninety-four bytes are a compressed list of eight strings. Two of these are empty strings and the other six are each newline separated flavours for one of the colours:
“...““...“...“...““...“...»
“...““...“...“...““...“...»
“                         » - a compression of dictionary words & or strings
    ““   “   “   ““   “     - list separations
    ^            ^          - the two empty lists of characters
 ...^ ... ... ...^ ... ...  - bytes used to encode the data
 wht  org grn ylw^ blu brn  - with the colours indicated. For example:
  1 2  3   4   5 6  7   0   -   “ḥĠḄĿĖṇ⁻Œḳ-¬"» is a compression of:
                            -     word     + word   + string + word       + word
                             -     "rotten" + " egg" + "s\n"  + "buttered" + " popcorn"
                             - and is at the fifth index, relating to "yellow"

The rest of the program parses the input to decide which list to use, splits the chosen list by newlines and picks a random element:
OḄị“...»ỴX - Main link:s e.g.: "blue"           "yellow"                  "brown"              "white"               "orange"                 "green"
O          - cast to ordinals  [98,108,117,101] [121,101,108,108,111,119] [98,114,111,119,110] [119,104,105,116,101] [111,114,97,110,103,101] [103,114,101,101,110]
 Ḅ         - from binary       3276             7125                      1151                 6899                  3272                     3489
  ị        - index into - 1 based and modular with 8 items so...
           -          indexes: 3276%8=4         7125%8=5                  1151%8=7             6899%8=3              3272%8=0                 3489%8=1
        Ỵ  - split at newlines (gets the list of flavours for the chosen colour)
         X - random choice (gets one of those flavours at random)

Python 2, 301 258 bytes
lambda x:choice({'e':'lawn clippings,lime,mucus,pear','l':'rotten eggs,buttered popcorn','u':'toothpaste,blue berry','a':'vomit,peach','o':'canned dog food,chocolate','i':'stinky socks,tutti-frutti,baby diapers,coconut'}[x[2]].split(','))
from random import*

Try it online!
Saved very many bytes by shortening the keys to use the 2nd index of the input, as suggested by @TheLethalCoder, and by splitting on commas instead of using a direct list.

Use eluaoi as the dictionary keys and access it with index 2 of the string should save you bytes.

Big (y) to LethalCoder's idea

Japt, 148 146 bytes
`È}hpÂŠ1½ue ¼rry
lawn c¦ppÄ1Ò˜1muc«1pe‡
vÇ1pea®
ÐXky socks1ÉÍi-frÔk1baby ¹ap€s1¬¬n©
¯nšd ºg food1®o¬ÓŠ
Î eggs1ç˜ª pop¬rn`·g`uÁ4`âUg2¹q1 ö

Try it online!
Saved 6 bytes thanks to Shaggy and ETHproductions

Split on R instead of 0 to save a byte. Also, you might be able to compress eluaoi by playing around with the order.

@Shaggy How would that save a byte? I would need to call qR which is the same length?

Check the Unicode shortcuts in the docs ;)

Sorry, forgot to say you can remove the space before ® too.

Nice, almost exactly what I had. You only need 5 of the 6 chars in the string because the missing one will have an index of -1, and therefore gets the last item in the array. If you use eaiou as the string you can compress it down to three bytes (there may be other three-byte combinations).

Also, if you do q1 after the correct line has been corrected you can save a byte that way.

142 bytes, which I think is pretty much the same as the improvements @ETHproductions suggested.

Java, 288 bytes
s->{String[]a="lawn clippings,lime,mucus,pear#rotten eggs,buttered popcorn#toothpaste,blue berry#vomit,peach#canned dog food,chocolate#stinky socks,tutti-frutti,baby diapers,coconut".split("#")["eluaoi".indexOf(s.charAt(2))].split(",");return a[new java.util.Random().nextInt(a.length)];}

Test it yourself!
Could be golfed by using a char[].
However the random part can't be "uniformly distributed" without the explicit use of Random.nextInt(int). Even (int)(Math.random()*a.length) isn't uniformly distributed.

Hmm, I din't get the explanation about why you have to use new java.util.Random().nextInt(a.length) instead of (int)(Math.random()*a.length)..

Math.random() provides a number that has some specificities (a power of 0 and a sign of 0 and 52 random bits). So you actually use an entropy of 52 without any further check. If length is 3, for instance, 2^52 is not divisible by 3. So it is not randomly distributed. This is why Random.nextInt(int) (actual java file, not javadoc, at line 394) has a loop mechanism to make sure the number is amongst fair numbers. Unless I'm said "it's good enough", only Random.nextInt(n) is fair.

@KevinCruijssen My mistake: it's 53 random bits, not 52.

Ah ok, thanks for the explanation. So Math.random() can't be used when 2^53 cannot be evenly divided by the number you multiply it with? So if you want a random number from 0-3, (int)(Math.random()*4) is acceptable to evenly divide it (four time 2251799813685248), but when you use *3 instead it isn't (which is three times 3002399751580330.666...), because casting it to int floors it, making some parts 1 smaller than others. And since length is variable in your case, it's not uniformly distributed either (with the possibility of being length 3).

Yep, you understood it all! If someone says "random", use Math.random(), if someone says something along "uniformly" or "fairly" random, use java.util.Random. That's also why I complained about Shaggy's answer.

T-SQL, 432 423 375 367 336 295 bytes
Finally, a set-based operation!!
SELECT TOP 1 SUBSTRING(value,2,99)
FROM t,STRING_SPLIT('elawn clippings-elime-emucus-epear-lrotten eggs-lbuttered popcorn-utoothpaste-ublue berry-avomit-apeach-ocanned dog food-ochocolate-istinky socks-itutti-frutti-ibaby diapers-icoconut','-')
WHERE SUBSTRING(c,3,1)=LEFT(value,1)
ORDER BY NEWID()

(Line breaks are for display and are not counted in total.)
Input is via column c in named table t, per our guidelines.
I'm simply joining our input table to a table full of the valid color/flavor combinations, then selecting a random row. ORDER BY NEWID() is a common way to randomize sort order in SQL. Depending on how strict you are, you might not consider it perfectly uniformly random, but it should be sufficiently random for jelly bean selection.
EDIT 1: Saved 9 bytes by using only the 3rd character of the color, inspired by other answers.
EDIT 2: Saved 48 bytes by putting the color flag and flavor in a single column. Lots of characters saved in the INSERT.
EDIT 3: Saved 8 bytes by replacing INSERT INTO b(o) with INSERT b
EDIT 4: Saved 31 more bytes by joining straight to the virtual table of VALUES and therefore eliminating the CREATE TABLE and INSERT.
EDIT 5: Save 41 bytes by upgrading to SQL 2016-only STRING_SPLIT function, which allows me to eliminate the variable and dynamic SQL execution.

><>, 311 bytes
</"y"/\_  _
v\i-?\x"sgge nettor"
v/"l"/\"nrocpop derettub"
v\i-?\x"etsaphtoot"
v/"o"/\"yrreb eulb"
v\i-?\x"etalocohc"
v/"n"/\"doof god dennac"
v\i-?\x"timov"
v/"n"/\"hcaep"
v\i-?\>x\/~~"srepaid ybab"
v"lime" x"sgnippilc nwal"
v"pear"x  _"sucum"
v    \~__>x\
v"coconut" x"skcos yknits"
>l?!;/\  \x_"itturf-ittut"

Try it online, or watch it at the fish playground
Featuring SK cosy knits and Doof God Dennac!
Explanation: The fish's first task is to figure out what the input word is by zig-zagging down the left hand side. The fish can only read one letter at a time, and it takes fewer bytes to do this destructively. First, the fish reads the first letter and asks if it's "y" — if it is, the word is "yellow", otherwise it moves on. It then reads the second letter — if it's "l", the word is "blue", otherwise it moves on; and so on. If it reads five letters and they don't match "y" (Yellow), "l" (bLue), "o" (brOwn), "n" (oraNge) or "n" (greeN) respectively, then the colour must have been "white".
Next comes the random bit. For the colours with two possible outputs, this is pretty straightforward — for yellow, for example, the fish enters the following code at the x:
/\
\x"sgge nettor"
 \"nrocpop derettub"

The x sets the direction randomly: if it's up or left, the fish swirls around the mirrors back to the x, but if it's right or down, it reads "rotten eggs" or "buttered popcorn" (in reverse).
The four-way splits (for white and green) are messier, but they follow the same general principal — the first is:
     >x\
"lime" x"sgnippilc nwal"
"pear"x   "sucum"
      __

Note that if the fish swims up from the first x, it passes through eight "s, which toggle string mode on and off four times, then it hits a mirror and swims back down.
To get to the last four-way split, the fish has to swim through the e and r of "lime" and "pear", which add e = 14 to the stack (and reverse it), so we first have to delete that with ~. One of the four branches also involves swimming through a junk string, "> ", which we delete with ~~.
    \   /~~"srepaid ybab"
    e   "
    r    _
    \~  >x\
"coconut" x"skcos yknits"
        \x_"itturf-ittut"
         _

Finally, after adding one of the bean flavours to the stack, the fish reaches the stream of vs in the leftmost column, which sends it to
v    \
v    o
>l?!;/

which prints characters (using one of the os in "coconut") until there are none left.

Mathematica, 247 bytes
R=RandomChoice
green=R@{lawn clippings,lime,mucus,pear}
yellow=R@{rotten eggs,buttered popcorn}
blue=R@{toothpaste,"blue berry"}
orange=R@{vomit,peach}
brown=R@{canned dog food,chocolate}
white=R@{stinky socks,tutti-frutti,baby diapers,coconut}
#&

Input   form

[green]

Can you index into the string and use the eluaoi trick? I don't know mathematica so just an idea.

Clojure, 231 bytes
#(rand-nth({\e["lawn clippings""lime""mucus""pear"]\l["rotten eggs""buttered popcorn"]\u["toothpaste""blue berry"]\a["vomit""peach"]\o["canned dog food""chocolate"]\i["stinky socks""tutti-frutti""baby diapers""coconut"]}(get % 2)))

Same idea as the others, I can just save some space compared to other languages.  Compressing strings seems like a lost cause.

PHP, 242 bytes
<?=($a=explode(_,[e=>'lawn clippings_lime_mucus_pear',l=>'rotten eggs_buttered popcorn',u=>'toothpaste_blue berry',a=>vomit_peach,o=>'canned dog food_chocolate',i=>'stinky socks_tutti-frutti_baby diapers_coconut'][$argn[2]]))[array_rand($a)];

Try it online!