text:
Build the Trinity Hall Prime
Based on this challenge and this Math.SE question. Idea originally come from a Numberphile video. The goal is to reproduce the logic of Professor McKee when he builds this prime.
Your task is to build the Trinity Hall Prime, at a much lower scale. You are given a single number N greater than 2, representing the length of the prime we need.
Rules

N is decomposed into a rectangle W(idth) x H(eight). W and H must be close, so 12 is 4x3 and 16 is 4x4 with W >= H
The first line got only 8's
The next lines have 8's in the outer and 1's in the middle
Each lines have 2 more 1's and 2 less 8's than the previous, except if W is odd, then the second line have only one 1 in the middle
Once you got your emblem, find the first prime greater than the emblem.
2 <= N <= 16
This is ascii-art, so newlines must be part of the output.
This is code-golf, so shortest code, in bytes, wins.

Test cases:
I   Emblem    O
================
2   88        89

3   888       907

4   88        88
    11        19

6   888       888
    818       827

8   8888      8888
    8118      8133

9   888       888
    818       818
    111       159

10  88888     88888
    88188     88213

16  8888      8888
    8118      8118
    1111      1111
    1111      1159

Python 3, 194 bytes
n=int(input())
R=range
w=n//max(i*(i*i<=n>1>n%i)for i in R(1,n))
m=0
for i in R(n):m=m*10+1+7*(abs(i%w*2-w+1)//2*w>i-w)
while any(m%p<1for p in R(2,m)):m+=1
m=str(m)
while m:print(m[:w]);m=m[w:]

Try it online!
too slow for most inputs, especially x > 8
-6 bytes thanks to Jonathan Frech
-98 bytes thanks to Leaky Nun

You can save two bytes by defining j="".join (adding 9+1 bytes) and replacing ''.join with j (saving 6*2 bytes; 10-12 = -2).

@JonathanFrech Cool, thanks

Also, as the input is always one integer, you can replace eval with int to save one entire byte. Using Python 2, one could entirely remove eval() (6 bytes) and the print parentheses (1 byte) to save 7 bytes.

Looks good, but the output should contains new lines in it! You are almost done.

@CyrilGandon done

I suggest you to golf this answer : https://stackoverflow.com/a/18833870/128662, because now, for N = 9, it takes more than a minute...

@CyrilGandon I might, but here on PPCG we usually don't care if things might take like 18 years

Ok I understand, I'm new to this game :p

@CyrilGandon That's ok :P Welcome to PPCG by the way! But yeah, except for [tag:fastest-code], as long as it's short that's fine :P :P :P

221 bytes

@LeakyNun o nice thanks

198 bytes

By defining ;R=range (+ 8 bytes) and replacing all other occurences of range with R (- 4*3 bytes), you can save -(8-12) = 4 bytes.

@JonathanFrech Oh cool thanks!

192 bytes

Jelly,  57  56 bytes
ŒgṖḊ$€2¦j8
Æd:2‘ịÆDðL€©8,8jÇÐĿḊ€ḣ€⁸Ṛ;®ẋ€⁸¤ḣ:@ðFḌÆnDṁ⁸Gḟ⁶

A monadic link taking a number and returning a list of characters. As a full program it prints the result.
Try it online!
How?
ŒgṖḊ$€2¦j8 - Link 1, previous 8-padded-row builder: list current 8-padded-row
           -                                         e.g. [8,8 , 1,1,1 , 8,8]
Œg         - group runs of equal elements                [[8,8],[1,1,1],[8,8]]
       ¦   - sparse application:
      2    - ...to indices: 2
    $€     - ...do: last two links as a monad for €ach:
  Ṗ        -   pop                                       [[8,8],[1,1  ],[8,8]]
   Ḋ       -   dequeue                                   [[8,8],[  1  ],[8,8]]
        j8 - join with eights                             [8,8, 8, 1, 8, 8,8]
           -   (note: from ...818... this yields an extra 8 - dealt with by ḣ€ in Main)

Æd:2‘ịÆDð... - Main link: number, N
Æd           - divisor count of N
  :2         - integer divided by 2
    ‘        - increment
      ÆD     - divisors of N
     ị       - index into (yields W)
        ð    - start a new dyadic chain with W on the left and N on the right...

...L€©8,8jÇÐĿḊ€ḣ€⁸Ṛ;®ẋ€⁸¤ḣ:@ð... - Main link (continued): W, N
   L€                            - length of €ach of implicit range(W) = list of W 1s
     ©                           - (copy to register for later reuse)
      8,8                        - literal [8,8]
         j                       - join -> [8,1,1,...,1,8] with W 1s
           ÐĿ                    - collect inputs until fixed point:
          Ç                      -   call the last link (1) as a monad
             Ḋ€                  - dequeue €ach (remove the leading 8 from each)
                 ⁸               - chain's right argument, N
               ḣ€                - head €ach to index (remove the trailing 8(s))
                  Ṛ              - reverse
                        ¤        - nilad followed by link(s) as a nilad:
                    ®            -   recall the [1,1,...W times...,1] from the register
                       ⁸         -   chain's left argument, W
                     ẋ€          -   repeat €ach (making W more rows of W 1s)
                   ;             - concatenate
                          :@     - integer division (sw@p arguments) = N:W = H
                         ḣ       - head to index (gets the first H rows - the mask, M)
                            ð    - start a new dyadic chain with arguments M, N

...FḌÆnDṁ⁸Gḟ⁶ - Main link (continued): M, N
   F          - flatten M
    Ḍ         - from decimal list to number
     Æn       - next prime
       D      - to decimal list
         ⁸    - chain's left argument, M
        ṁ     - mould like (reshape like the mask)
          G   - format as a grid (all digits to characters, add spaces and newlines)
            ⁶ - literal space character
           ḟ  - filter discard (Gḟ⁶ instead of Y as single row results are possible)
              - as a full program: implicit print

Beautiful result, how Jelly succeed to find a prime that fast with 360 digits?

Jelly uses sympy's nextprime, which in turn makes use of its isprime which, for numbers greater than 2^64, uses BPSW - while this is a probabilistic test no composite false-positives are known. Note that it takes a lot longer if one tries 1350 (times out on TIO).


text:
Kolakoski-like self-referencing sequences
This is how the Kolakoski sequence (OEIS A000002) is defined:

The Kolakoski sequence is a sequence that contains 1 and 2, and the nth element of the sequence is the length of the nth group of equal elements (run) in the sequence itself. The first 20 terms of the sequence and the respective lengths are:
1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1
- --- --- - - --- - --- --- - --- --- -
1  2   2  1 1  2  1  2   2  1  2   2  1

Essentially, the lengths of the groups of equal elements of the Kolakoski sequence is the Kolakoski sequence itself.

So far, so good, but that why should we restrict ourselves to 1 and 2? We're not going to! Given two inputs, an array of positive integers A and an integer N, return the first N terms of the Kolakoski-like sequence defined by cycling through A. To get the grasp of it better, here is a worked example with the lengths of the newly added groups in brackets:
A = [2, 3, 1]
N = 25

2: [[2], 2 ]
3: [ 2 ,[2], 3 , 3 ]
1: [ 2 , 2 ,[3], 3 , 1 , 1 , 1 ]
2: [ 2 , 2 , 3 ,[3], 1 , 1 , 1 , 2 , 2 , 2 ]
3: [ 2 , 2 , 3 , 3 ,[1], 1 , 1 , 2 , 2 , 2 , 3 ]
1: [ 2 , 2 , 3 , 3 , 1 ,[1], 1 , 2 , 2 , 2 , 3 , 1 ]
2: [ 2 , 2 , 3 , 3 , 1 , 1 ,[1], 2 , 2 , 2 , 3 , 1 , 2 ]
3: [ 2 , 2 , 3 , 3 , 1 , 1 , 1 ,[2], 2 , 2 , 3 , 1 , 2 , 3 , 3 ]
1: [ 2 , 2 , 3 , 3 , 1 , 1 , 1 , 2 ,[2], 2 , 3 , 1 , 2 , 3 , 3 , 1 , 1 ]
2: [ 2 , 2 , 3 , 3 , 1 , 1 , 1 , 2 , 2 ,[2], 3 , 1 , 2 , 3 , 3 , 1 , 1 , 2 , 2 ]
3: [ 2 , 2 , 3 , 3 , 1 , 1 , 1 , 2 , 2 , 2 ,[3], 1 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 3 ]
1: [ 2 , 2 , 3 , 3 , 1 , 1 , 1 , 2 , 2 , 2 , 3 ,[1], 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 3 , 1 ]
2: [ 2 , 2 , 3 , 3 , 1 , 1 , 1 , 2 , 2 , 2 , 3 , 1 ,[2], 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 3 , 1 , 2 , 2 ]
C: [ 2 , 2 , 3 , 3 , 1 , 1 , 1 , 2 , 2 , 2 , 3 , 1 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 3 , 1 , 2 , 2 ]

Here is another worked example with a leading 1:
A = [1, 2, 3]
N = 10

1: [[1]]
2: [ 1 ,[2], 2 ]
3: [ 1 , 2 ,[2], 3 , 3 ]
1: [ 1 , 2 , 2 ,[3], 3 , 1 , 1 , 1 ]
2: [ 1 , 2 , 2 , 3 ,[3], 1 , 1 , 1 , 2 , 2 , 2 ]
C: [ 1 , 2 , 2 , 3 , 3 , 1 , 1 , 1 , 2 , 2 ]

As you can see above, the final result was cut to N = 10 elements. The nth element should be how long the nth equal-element group is, even if the element itself belongs in the group it refers to. As in the above case, the first 1 refers to the first such group which is just that 1, and the first 2 refers to the second such group, which starts with it.
Rules

You may assume that A will never have two or more consecutive equal elements. A may contain an integer more than once, but the first and last elements will not be equal, and A will contain at least 2 elements (e.g. [1, 2, 2, 3], [2, 4, 3, 1, 2] and [3] aren't going to be given). That's because if there were consecutive equal elements, the final result would've been an invalid prefix for such a sequence.
You may assume A only contains positive integers (as such a sequence would be otherwise undefined).
You may assume N is a non-negative integer (N >= 0).
You can't return more terms than requested.
Using any one of the standard loopholes is strictly forbidden.
You may use any reasonable I/O method.
Your answer doesn't have to work beyond natural language limits, but in theory your algorithm should work for arbitrarily large inputs and integers.
This is code-golf, so the shortest answer wins.

Test cases
[5, 1, 2], 0 -> []
[2, 3, 1], 25 -> [2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 2, 2, 3, 3, 3, 1, 2, 2]
[1, 2, 3], 10 -> [1, 2, 2, 3, 3, 1, 1, 1, 2, 2]
[1, 2], 20 -> [1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1]
[1, 3], 20 -> [1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3]
[2, 3], 50 -> [2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 3, 3]
[7, 4], 99 -> [7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 7, 7, 7, 7, 4, 4, 4, 4, 7, 7, 7, 7, 4, 4, 4, 4, 7, 7, 7, 7, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 4]
[1, 2, 3], 5 -> [1, 2, 2, 3, 3]
[2, 1, 3, 1], 2 -> [2, 2]
[1, 3, 5], 2 -> [1, 3]
[2, 3, 2, 4], 10 -> [2, 2, 3, 3, 2, 2, 2, 4, 4, 4]

sandbox (2k+ users)

Related.

@MartinEnder thought I linked that already

Husk, 8 bytes
Ṡωȯ↑⁰`Ṙ¢

Takes first the length, then the list.
Try it online!
Explanation
Ṡωȯ↑⁰`Ṙ¢  Inputs: n=9 and x=[2,1,3]
Ṡωȯ       Apply the following function to x until a fixed point is reached:
           Argument is a list, say y=[2,2,1,3,3,3]
       ¢   Cycle x: [2,1,3,2,1,3..
     `Ṙ    Replicate to lengths in y: [2,2,1,1,3,2,2,2,1,1,1,3,3,3]
   ↑⁰      Take first n elements: [2,2,1,1,3,2,2,2,1]
          Final result is [2,2,1,1,3,2,1,1,1], print implicitly.

Pyth, 14 bytes
u<s*V]M*QlGGvz

Try it online: Demonstration or Test suite
Explanation:
u                 start with G = input array
       *QlG       repeat input array
     ]M           put every element into its own list
   *V      G      repeat every list vectorized by the counts in G
  s               flatten
 <          vz    take the first (second input line) numbers
                  and assign them to G until you reach fixed point

Interesting alternative: u&VSvzs*V]M*Ql

This is a nice approach.

R, 120 114 108 bytes
-6 bytes thanks to plannapus
function(A,N){i=inverse.rle
w=length
a=rle(A)
while(w(a$l)<N){a[[1]]=i(a)
a[[2]]=rep(A,l=w(a$l))}
i(a)[0:N]}

Try it online!
Anonymous function; successively inverts the RLE, replacing the lengths a[[1]] with the inverted RLE, and the values a[[2]] with A replicated to a length equal to that of a$l.

@plannapus ah, right! I did try that and crashed R because in assignment, it'll create a$l and a$v if they don't exist, but they won't affect the call to inverse.rle, causing an infinite loop. I think I can only use a$l in the while condition and the rep condition.

Java 8, 151 + 19 119 115 bytes
a->n->{int c=0,l[]=new int[n],i=0,j;for(;i<n;i++)for(j=0;j<(c==i?a[i]:l[i])&c<n;j++)l[c++]=a[i%a.length];return l;}

Try it online!

You can reduce four bytes by getting rid of two parenthesis, changing && to & and removing a comma: a->n->{int c=0,l[]=new int[n],i=0,j;for(;i<n;i++)for(j=0;j<(c==i?a[i]:l[i])&c<n;j++)l[c++]=a[i%a.length];return l;} (115 bytes)

Suggest (c==i?a:l)[i] instead of c==i?a[i]:l[i]

Haskell, 68 bytes
Many thanks to Laikoni and flawr for their help in debugging and golfing this answer in the PPCG Haskell chatroom, Of Monads and Men. Golfing suggestions welcome! Try it online!
(.f).take
f a@(z:_)=(z<$[1..z])++do i<-[1..];cycle a!!i<$[1..f a!!i]

The first line is an anonymous function. The second line is the infinite list comprehension that produces our Kolakoski-like sequence.
Explanation
First, we define z as the head of a with a@(z:_). Then, we initialize the sequence with (z<$[1..z]).
Then, from 1 onwards, do i<-[1..], we append the following to the sequence: cycle a!!i<$[1..f a!!i], which is the i-th member of a (cycled indefinitely) appended f a!!i times.
Finally, the anonymous function simply takes the first n terms of our Kolaskoski-like sequence.

Python 2, 123 bytes
x,y=input()
k=x[0]
t,j=[],0
if k==1:t,j=[k]+x[1]*[x[1]],2
while len(t)<y:t+=(j and t[j]or k)*[x[j%len(x)]];j+=1
print t[:y]

Try it online!

source: Stack Exchange

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

sort: votes


text:
The Uncommon Factor Number
Based on a chat message
The Challenge
Given an input number \$n > 9\$, construct its reverse, ignoring leading zeros. Then, construct a list of all prime factors that the number and its reverse don't have in common. Multiply those factors together to create the Uncommon Factor Number of the input.
Or, to put it another way: if \$\text{rev}(n)\$ denotes the decimal reversal of integer \$n\$, calculate the product of \$n\$ and \$\text{rev}(n)\$ divided by the square of the \$\gcd(n, \text{rev}(n))\$.
Output that number.
Worked examples
For example, \$2244\$ reverses to \$4422\$. The prime factors of the first are \$[2, 2, 3, 11, 17]\$ and the prime factors of the reverse are \$[2, 3, 11, 67]\$. The numbers not in common multiplicities are \$[2, 17, 67]\$, so \$2278\$ is the output.
For another example, \$1234\$ reverses to \$4321\$. The product is \$5332114\$ and the GCD is \$1\$, so the output is \$5332114\$.
Further clarifications
Obviously a palindromic number will have all its factors in common with its reverse, so in such a case the output is \$1\$ \$\left(\frac{n\times n}{n^2}\right)\$. Obviously, it's also possible for the output to be the multiplication all factors (i.e., the gcd is \$1\$ -- the input and its reverse are co-prime), as in the case of the \$1234\$ example.
Rules

The input and output can be assumed to fit in your language's native integer type.
The input and output can be given in any convenient format.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so other people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Examples
in
out

17
1207

208
41704

315
1995

23876
101222302

Can we assume the input will not have leading zeros?

@Mr.Xcoder Huh? You mean trailing zeroes?

@EriktheOutgolfer No, leading zeros is exactly what I mean. Also

@Mr.Xcoder Yes, that's a safe assumption, given that you're given a number, and we generally don't write numbers with leading zeros anyway?

The second test case should be 1995 (I believe)

@Mr.Xcoder Yes. Don't know how I messed that one up.

@AdmBorkBork Then my Jelly answer is valid :p

Perhaps add a test case where some factor is repeated after the symmetric difference. An initial version of my answer failed at that

For example 208 -> 41704

@LuisMendo Thanks. Good addition.

Is string input allowed? Like, with quotes?

@EriktheOutgolfer Sure, that's standard.

so you can take the input as a list of digits?

@Jonah Sure, that's allowed. Input/Output isn't the interesting part of this challenge, so I'm pretty flexible.

05AB1E, 6 bytes
Code
Â‚D¿÷P

Uses the 05AB1E encoding. Try it online!
Explanation
Â‚        # Get the array [input, reversed(input)]
  D       # Duplicate that array
   ¿      # Calculate the GCD of the array
    ÷     # Divide each element in the array by the GCD
     P    # Product of that array

A nice, simple alternative to the formula provided in the challenge - +1. Tried the same in Japt but it came out 2 bytes longer than what I already had.

J, 18 bytes
".@|.@":(*%*:@+.)]

Try it online!
Alternatively (credit to @Adnan's approach for the second one),
".@|.@":(*%2^~+.)]
".@|.@":*/@(,%+.)]

J, 15 bytes (@miles's solution)
*/@(,%+.)|.&.":

Explanation
This is just a straightforward implementation of the algorithm given by the OP.
".@|.@":(*%*:@+.)]
                 ]  n (input)
".@|.@":            n reversed
         *          Product of the two
          %         Divided by
              +.      GCD
           *:         Squared

Explanation, @miles's solution
Very clever.
*/@(,%+.)|.&.":
         |.&.":  Reverse digits
           &.":   Convert to string, apply next function, and undo conversion
         |.       Reverse
   (,%+.)        Divide n and reverse(n) by GCD of both
*/               Product

15 bytes with */@(,%+.)|.&.":

@miles I love the under trick

@miles that one is really slick.

Why not submit the 15 byte version as your main solution?

@Shaggy Not sure. My inclination was to respond with "it's significantly different from my own," but it's really just two optimizations. I'll get to updating it later.

Mathematica, 33 bytes
#(s=IntegerReverse@#)/GCD[#,s]^2&

Try it online!

Jelly, 8 bytes
,ṚḌµ:g/P

Try it online!

Dammit, I had exactly the same (except DU instead of Ṛ)

@ETHproductions Yeah Ṛ on an integer reverses the digits but doesn't convert back to an integer.

R, 108 89 bytes
-19 bytes thanks to plannapus for his gcd algorithm
function(n){k=1:nchar(n)-1
q=1:n
(r=sum(n%/%10^k%%10*10^rev(k)))*n/max(q[!r%%q&!n%%q])^2}

This will attempt to allocate at least one vector of size 4*n bytes (and I think as many as 4), so this will throw a memory error for sufficiently large n.
Try it online!

JavaScript, 67 64 60 59 bytes
So many bytes just to reverse the number :(
Takes input as a string. 1 byte saved thanks to l4m2.
f=(n,x=n,y=r=[...n].reverse().join``)=>y?f(n,y,x%y):n*r/x/x

Try it online!

n*r/x/x?aaaaaaaaaaa

Haskell, 44 bytes
f x|r<-read$reverse$show x=x*r`div`gcd x r^2

Try it online!

Python 3, 73 68 bytes
-5 bytes thanks to Mr. Xcoder.
import math
def f(n):g=int(str(n)[::-1]);print(n*g/math.gcd(n,g)**2)

Try it online!

68 bytes

Pyth, 13 bytes
/*QKs_`Q^iKQ2

Try it here!
Pyth, 15 bytes
This uses Adnan's approach and takes input as a String.
KsM_BQ*Fm/diFKK

Try it here

Japt, 13 12 11 bytes

sw
*V/yU ²
Try it

Explanation
Implicit input of integer U. The empty line at the beginning, prevents the following line from overwriting U
sw

Convert U to a string (s), reverse it (w), convert back to an integer and assign to variable V.
*V

Multiply U by V.
/

Divide.
yU

GCD of V and U.
²

Squared. Implicit output of resulting integer.

Alternative, 13 bytes
Just because I like being able to use N.
NpUsw)mxNry)×

Try it

Smart trick with GCD. I think that algorithm might actually be shorter than the current Jelly solution...

@ETHproductions In Jelly GCD ends up being longer...

@EriktheOutgolfer I "have" an 8-byte version, but this involves dividing the results of two dyads and I'm not sure how to properly do that...

MATL, 13 12 11 bytes
tVPU*1MZdU/

Try it online! Or verify all test cases.
Explanation
t      % Imoplicit input: number. Duplicate
VPU    % String representation, flip, evaluate. This reverses digits
*      % Multiply input and reversed-digit version
1M     % Push the input and reversed-digit version again
Zd     % Greatest common divisor
U      % Square
/      % Divide. Implicit display

Neim, 11 bytes
₁₁ᛦ

Try it online!
No GCD built-in. ;-;

Husk, 10 bytes
S¤§÷o□⌋*i↔

Try it online!
-1 thanks to H.PWiz.
-1 thanks to Zgarb.

x86 Machine Code, 39 bytes
;;; Obtain a "reversed" version of the input value.
;;;
;;; To do this, each iteration of a loop, we take the input value modulo 10,
;;; add that to our accumulator (EDI), multiply the accumulator by 10, and
;;; divide the input value by 10. x86's DIV instruction does both modulo and
;;; division as a single operation, with the cost of clobbering two output
;;; registers (EAX and EDX). We clobber the input value throughout the loop
;;; (the way we know we're done is when it becomes 0---that means that we have
;;; pulled all of the digits off of it), so we need to save a copy of it first.
89 C8           mov    eax, ecx     ; make copy of input
31 FF           xor    edi, edi     ; clear accumulator
6A 0A           push   10
5E              pop    esi          ; set ESI to 10
             Reverse:
0F AF FE        imul   edi, esi     ; accumulator *= 10
99              cdq                 ; zero EDX in preparation for division
F7 F6           div    esi          ; EDX:EAX / 10 (EAX is quot, EDX is rem)
01 D7           add    edi, edx     ; accumulator += remainder
85 C0           test   eax, eax     ; was quotient 0?
75 F4           jnz    Reverse      ; if not, keep looping and extracting digits

;;; At this point, EAX is 0 (clobbered throughout the loop),
;;; ECX still contains a copy of our original input, and
;;; EDI contains the 'reversed' input.
89 C8           mov    eax, ecx     ; make another copy of the input
F7 E7           mul    edi          ; multiply input (implicit EAX operand)
                                    ;  by 'reversed', with result in EDX:EAX
                                    ;  (note: EDX will be 0)

;;; Compute the greatest common denominator (GCD) of the input and
;;; the 'reversed' values, using a subtraction-based algorithm.
             GCD_0:
39 CF           cmp    edi, ecx     ; compare the two values
72 02           jb     GCD_1        ; go to GCD_1 if less than
87 F9           xchg   ecx, edi     ; swap values
             GCD_1:
29 F9           sub    ecx, edi     ; subtract
75 F6           jnz    GCD_0        ; if sum != 0, go back to the top

;;; Square the GCD.
0F AF FF        imul   edi, edi

;;; Divide the product of input and 'reversed' by the square of the GCD.
;;; Remember from above that the product of input and 'reversed' is in
;;; the EAX register, and we can assume EDX is 0, so we don't need to do
;;; a CDQ here in preparation for the division. Using EAX as the implicit
;;; source operand saves us a byte when encoding DIV.
F7 F7           div    edi

;;; The DIV instruction placed the quotient in EAX,
;;; which is what we want to return to the caller.
C3              ret

The above function computes the "uncommon factor number" of the specified input parameter. Following the register-based __fastcall calling convention, the parameter is passed in the ECX register. The result is returned in the EAX register, as with all x86 calling conventions.
Try it online!
This took an awfully long time to write in such a compact form, but it was a fun exercise. Lots of contortions to get the most optimal register scheduling possible, within the constraints of the x86 DIV instruction's implicit operands and trying to use short encodings of MUL and XCHG instructions whenever possible. I'd be very curious to see if someone can think of another way to shorten it further. My brain was quite fried by the end. Thank a compiler next time you see one! (Although this is way better code than what a compiler would generate... Especially if you tweaked it slightly without size constraints, removing things like XCHG.)

Jelly, 7 bytes
ṚḌæl:gɗ

Try it online!
-1 byte thanks to ovs
Similar to Erik's Jelly answer, but uses a dyadic route rather than monadic lists.
Uses the formula found by ovs
$$\text{UCF}(n) = \frac{\text{lcm}(n,\text{rev}(n))}{\gcd(n, \text{rev}(n))}$$
How it works
ṚḌæl:gɗ - Main link. Takes n on the left
Ṛ       - Split n into digits and reverse
 Ḍ      - Convert back into an integer; rev(n)
      ɗ - Combine the previous three links into a dyad
           with n on the right and rev(n) on the left:
  æl    -   lcm(n,rev(n))
     g  -   gcd(n, rev(n))
    :   -   Divide lcm(n,rev(n)) by gcd(n, rev(n))

I must be missing something here since no one uses that approach, but with a*b/gcd(a,b)=lcm(a,b) this should work for 7 bytes: ṚḌæl:gɗ

@ovs I can't see any obvious problem with that, and it seems to work for all the test cases, nice!

APL (Dyalog Extended), 9 bytes
⊢(∧÷∨)⌽⍢⍕

Try it online!
$$\text{UCF}(n) = \frac{n\times \text{rev}(n)}{\gcd(n, \text{rev}(n))^2} = \frac{\text{lcm}(n,\text{rev}(n))}{\gcd(n,\text{rev}(n))} = \frac{\text{lcm}}{\gcd}(n,\text{rev}(n))$$
⌽ reverse ⍢ under ⍕ conversion to string, then apply ∧÷∨ (lcm ÷ gcd) between the result and and the original argument.

Pyt, 11 bytes
ĐĐ₫Đ3Ș*↔Ǥ²/

Try it online!

Code
Stack
Description

Đ
n,n
Implicit input; duplicate top of stack

Đ
n,n,n
Duplicate top of stack

₫
n,n,rev(n)
Reverse the digits of the top of the stack

Đ
n,n,rev(n),rev(n)
Duplicate top of stack

3Ș
n,rev(n),rev(n),n
Flip the order of the top three items on the stack

*
n,rev(n),rev(n)*n
Multiply the top two items on the stack

↔
rev(n)*n,rev(n),n
Flip the stack

Ǥ²
rev(n)*n,gcd(n,rev(n))^2
Take the gcd of n and rev(n) and square it

/
rev(n)*n/(gcd(n,rev(n))^2)
Divide; implicit print

Java 8, 158 150 148 138 125 123 116 107 + 19 bytes
i->{int o,r,f,t=f=i;i=r=i.valueOf(""+new StringBuffer(t+"").reverse());while(t>0)t=i%(i=t);return f/i*r/i;}

Try it online!

In the while loop, you can replace t!=0 by t>0, since t will never be negative. f*r/(i*i) is the same as f/i*r/i. You can drop f=t; and r=i; if you chain the assignment of i and t.

The while loop can be written as while(t>0)t=i%(i=t); (-11 bytes).

Python 2, 70 bytes
Thanks to i cri everytim.
def f(n):g=int(`n`[::-1]);print n*g/gcd(n,g)**2
from fractions import*

Try it online!
Python 2, 77 bytes
Note that in Python 2, you cannot use the math.gcd() method, and you must do it "by hand".
y=lambda a,b:b and y(b,a%b)or a
def f(n):g=int(`n`[::-1]);print n*g/y(n,g)**2

Try it online!

Python 3 has gcd as fractions.gcd.

@icrieverytim That's why I chose to solve it in Python 2.

...Whoops, I meant Python 2. Python 3 has math.gcd.

@icrieverytim done.

Perl 5, 72 bytes
71 bytes of code + 1 flag (-p)
$t=$_*($b=reverse);($_,$b)=(abs$_-$b,$_>$b?$b:$_)while$_-$b;$_=$t/$_**2

Try it online!

Pyke, 8 bytes
_]FbP).^B

Try it here!
Takes input as a string.
_         -    reversed(input)
 ]        -   [^, input]
  FbP)    -  for i in ^:
   b      -     int(^)
    P     -    factors(^)
      .^  -  xor_seq(^)
        B - product(^)

Ohm, 9 bytes
DR«D]Æ┴/µ

Try it online!

psst... Ohm v2 is out and better than ever!

Vyxal, 7 bytes
Ṙ∆Ŀ?Ḃġ/

Try it Online!
Ṙ       # Reverse
 ∆Ŀ     # LCM with that
   ?    # Take input
    Ḃ   # Dupe-reverse
     ġ  # GCD
      / # Quoitent

Would be 5 bytes if parallel apply worked with digraphs.

J-uby, 25 bytes
Uses ovs' technique.
:/%[:lcm%r=S|:~|Z,:gcd%r]

Attempt This Online!
Explanation
:/ % [:lcm % r = S | :~ | Z, :gcd % r]

             r = S | :~ | Z             # Helper function: Convert to string, reverse, convert back to int
:/ % [                     ,         ]  # Divide...
      :lcm % r                          #   LCM of input and its reverse by
                             :gcd % r   #   GCD of input and its reverse

J-uby, 32 bytes
We can get rid of the awkward helper function r but at a cost of seven bytes:
:/%(-[:%&:lcm,:%&:gcd]^(S|:~|Z))

Attempt This Online!

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/


text:
Gimli, make it even shorter?
I'm one of the authors of Gimli. We already have a 2-tweet (280 chars) version in C but I would like to see how small it can get.
Gimli (paper,website) is a high speed with high security level cryptographic permutation design that will be presented at the Conference on Cryptographic Hardware and Embedded Systems (CHES) 2017 (September 25-28).
The task

As usual: to make the smalled usable implementation of Gimli in the language of your choice.
It should be able to take as input 384 bits (or 48 bytes, or 12 unsigned int...) and return (may modify in place if you use pointers) the result of Gimli applied on these 384 bits.

Input conversion from decimal, hexadecimal, octal or binary is allowed.
Potential corner cases
Integer encoding is assumed to be little-endian (e.g. what you probably already have).
You may rename Gimli into G but it must still be a function call.
Who wins?
This is code-golf so the shortest answer in bytes wins!
Standard rules apply of course.
A reference implementation is provided below.
Note
Some concern has been raised:

"hey gang, please implement my program for free in other languages so I don't have to" (thx to @jstnthms)

My answer is as follow:

I can easily do it in Java, C#, JS, Ocaml... It is more for the fun. Currently We (the Gimli team) have it implemented (and optimized) on AVR, Cortex-M0, Cortex-M3/M4, Neon, SSE, SSE-unrolled, AVX, AVX2, VHDL and Python3. :)

About Gimli
The state
Gimli applies a sequence of rounds to a 384-bit state. The state is represented as a parallelepiped with dimensions 3×4×32 or, equivalently, as a 3×4 matrix of 32-bit words.

Each round is a sequence of three operations:

a non-linear layer, specifically a 96-bit SP-box applied to each column;
in every second round, a linear mixing layer;
in every fourth round, a constant addition.

The non-linear layer.
The SP-box consists of three sub-operations: rotations of the first and second words; a 3-input nonlinear T-function; and a swap of the first and third words.

The linear layer.
The linear layer consists of two swap operations, namely Small-Swap and Big-Swap. Small-Swap occurs every 4 rounds starting from the 1st round. Big-Swap occurs every 4 rounds starting from the 3rd round.

The round constants.
There are 24 rounds in Gimli, numbered 24,23,...,1. When the round number r is 24,20,16,12,8,4 we XOR the round constant (0x9e377900 XOR r) to the first state word.

reference source in C
#include <stdint.h>

uint32_t rotate(uint32_t x, int bits)
{
  if (bits == 0) return x;
  return (x << bits) | (x >> (32 - bits));
}

extern void gimli(uint32_t *state)
{
  int round;
  int column;
  uint32_t x;
  uint32_t y;
  uint32_t z;

  for (round = 24; round > 0; --round)
  {
    for (column = 0; column < 4; ++column)
    {
      x = rotate(state[    column], 24);
      y = rotate(state[4 + column],  9);
      z =        state[8 + column];

      state[8 + column] = x ^ (z << 1) ^ ((y&z) << 2);
      state[4 + column] = y ^ x        ^ ((x|z) << 1);
      state[column]     = z ^ y        ^ ((x&y) << 3);
    }

    if ((round & 3) == 0) { // small swap: pattern s...s...s... etc.
      x = state[0];
      state[0] = state[1];
      state[1] = x;
      x = state[2];
      state[2] = state[3];
      state[3] = x;
    }
    if ((round & 3) == 2) { // big swap: pattern ..S...S...S. etc.
      x = state[0];
      state[0] = state[2];
      state[2] = x;
      x = state[1];
      state[1] = state[3];
      state[3] = x;
    }

    if ((round & 3) == 0) { // add constant: pattern c...c...c... etc.
      state[0] ^= (0x9e377900 | round);
    }
  }
}

Tweetable version in C
This might not be the smallest usable implementation but we wanted to have a C standard version (thus no UB, and "usable" in a library).
#include<stdint.h>
#define P(V,W)x=V,V=W,W=x
void gimli(uint32_t*S){for(long r=24,c,x,y,z;r;--r%2?P(*S,S[1+y/2]),P(S[3],S[2-y/2]):0,*S^=y?0:0x9e377901+r)for(c=4;c--;y=r%4)x=S[c]<<24|S[c]>>8,y=S[c+4]<<9|S[c+4]>>23,z=S[c+8],S[c]=z^y^8*(x&y),S[c+4]=y^x^2*(x|z),S[c+8]=x^2*z^4*(y&z);}

Test vector
The following input generated by
for (i = 0;i < 12;++i) x[i] = i * i * i + i * 0x9e3779b9;

and "printed" values by
for (i = 0;i < 12;++i) {
  printf("%08x ",x[i])
  if (i % 4 == 3) printf("\n");
}

thus:
00000000 9e3779ba 3c6ef37a daa66d46
78dde724 1715611a b54cdb2e 53845566
f1bbcfc8 8ff34a5a 2e2ac522 cc624026

should return:
ba11c85a 91bad119 380ce880 d24c2c68
3eceffea 277a921c 4f73a0bd da5a9cd8
84b673f0 34e52ff7 9e2bef49 f41bb8d6

A tweet is 140 chars, not a 280

I know, which is why it fits into 2 ;) https://twitter.com/TweetGimli .

"hey gang, please implement my program for free in other languages so I don't have to"

hahaha Nah I already have it in Python, and I can easily do it in Java, C#, JS. It is more for the fun. :)

Currently I have it implemented on AVR, Cortex-M0, Cortex-M3/M4, Neon, SSE, SSE-unrolled, AVX, AVX2 and Python3.

The reference code on the website has a crucial error, -round instead of --round means that it never terminates. Converting -- to an en dash is probably not suggested in code :)

@Shaggy updated.

"2-tweet" hey, now you have a 1-tweet version!

my 112-bytes binary version is only 154 bytes in base64.  You can tweet that now.

and when base85-encoded, it's exactly 140 bytes

CJam (114 chars)
{24{[4/z{[8ZT].{8\#*G8#:Mmd+}__)2*\+.^W%\[_~;&8*\~@1$|2*@@&4*].^Mf%}%z([7TGT]R=4e!=\f=(2654435608R-_4%!*^\@]e_}fR}

This is an anonymous block (function): if you want to name it G then append :G. In CJam assigned names can only be single upper-case letters. There's space to append a comment e# Gimli in CJam and have characters left in a single tweet.
Online test
Dissection
{                                e# Define a block
  24{                            e# For R=0 to 23...
    [                            e#   Collect values in an array
      4/z                        e#     Transpose to columns
      {                          e#     Map over each column
        [8ZT].{8\#*G8#:Mmd+}     e#       Rotations, giving [x y z]
        __)2*\+.^W%\             e#       => [y^z x^y x^z*2] [x y z]
        [_~;&8*\~@1$|2*@@&4*].^  e#       => [x' y' z']
        Mf%                      e#       Map out any bits which overflowed
      }%
      z                          e#    Transpose to rows
      ([7TGT]R=4e!=\f=           e#    Permute first row
      (2654435608R-_4%!*^        e#    Apply round constant to first element
      \@                         e#    Put the parts in the right order
    ]e_                          e#  Finish collecting in array and flatten
  }fR
}

For a moment I was thrown of by the fact that the ouput was not in hex (in the online test). :)

C (gcc), 237 bytes
#define P(a,l)x=a;a=S[c=l>>r%4*2&3];S[c]=x;
r,c,x,y,z;G(unsigned*S){
for(r=24;r;*S^=r--%4?0:0x9e377901+r){
for(c=4;c--;*S++=z^y^8*(x&y))
x=*S<<24|*S>>8,y=S[4]<<9|S[4]>>23,z=S[8],S[8]=x^2*z^4*(y&z),S[4]=y^x^2*(x|z);
S-=4;P(*S,33)P(S[3],222)}}

I probably gained bytes with my swapping method, but it's too cute not to use.

lost or gained?

@HyperNeutrino Gained, making me a loser :)

Ah ok :P makes sense :P :P

This is still definitely an improvement, but it's somewhat cheating to use unsigned instead of uint32_t (and OP's code was somewhat cheating to use long) because the idea behind the cipher is that it's highly portable. (In fact, fundamentally this saves a mere 8 bytes).

@PeterTaylor Even though my code is similar, I'm not really competing against OP's code. I'm working under the rules of PPCG, where it must work with at least an implementation on a platform, and it does with gcc on a 32-bit or 64-bit Intel CPU (and probably many more).

@orlp I really like your column traversal too. :)

@Biv And this technique, to use a bitshift as a small lookup table is actually a side-channel resistant form of doing lookup tables, so potentially useful in implementing crypto primitives :) Obviously in the way it's used here the access pattern is always consistent and public information, so no reason to worry about cache effects, but the technique is interesting regardless.

C, 268 chars (268 bytes) using uint32_t
NB Since the original code uses <stdint.h> and types S as uint32_t *, I think the use of long is a cheat to get into 280 chars at the cost of the portability which is the reason for using uint32_t in the first place. If for fairness of comparison we require consistent use of uint32_t and the explicit signature void gimli(uint32_t *), the original code is really 284 chars, and orlp's code is 276 chars.
#include<stdint.h>
#define R(V)x=S[V],S[V]=S[V^y],S[V^y]=x,
void gimli(uint32_t*S){for(uint32_t r=24,x,y,z,*T;r--;y=72>>r%4*2&3,R(0)R(3)*S^=y&1?0x9e377901+r:0)for(T=S+4;T-->S;*T=z^y^8*(x&y),T[4]=y^x^2*(x|z),T[8]=x^2*z^4*(y&z))x=*T<<24|*T>>8,y=T[4]<<9|T[4]>>23,z=T[8];}

This can be split into two tweets with continuation markers as
#include<stdint.h>
#define R(V)x=S[V],S[V]=S[V^y],S[V^y]=x,
void gimli(uint32_t*S){for(uint32_t r=24,x,y,z,*T;r--;y=72>>r%4*2&3,R(0)R(3)// 1

and
*S^=y&1?0x9e377901+r:0)for(T=S+4;T-->S;*T=z^y^8*(x&y),T[4]=y^x^2*(x|z),T[8]=x^2*z^4*(y&z))x=*T<<24|*T>>8,y=T[4]<<9|T[4]>>23,z=T[8];}// 2/2

The use of long in my version is safe (with respect to portability) because the minimum size of a long is 32 bits by the standard (as opposed to int). Rotations of x and y are done before the cast into long at the assignment, making them safe (as the right shift on signed value is CC dependent). The cast when going back to the uint32_t* S) gets rid of the upper bits and puts us in the right state :).

Java (OpenJDK 8), 351 343 339 320 318 247 + 56 bytes
Just a near 1:1 port of the reference to start golfing from.
void f(int[]x,int y,int z){int q=x[y];x[y]=x[z];x[z]=q;}

s->{for(int r=24,c,x,y,z;r>0;--r){for(c=0;c<4;x=s[c]<<24|s[c]>>>8,y=s[4+c]<<9|s[4+c]>>>23,z=s[8+c],s[8+c]=x^z<<1^(y&z)<<2,s[4+c]=y^x^(x|z)<<1,s[c++]=z^y^(x&y)<<3);if((r&3)==2){f(s,0,2);f(s,1,3);}if((r&3)<1){f(s,0,1);f(s,2,3);s[0]^=0x9e377900|r;}}}

Try it online!

Why use Integer at all? o_O Since you don't use any Integer method, there's no reason to not use ints here...

@OlivierGrégoire I think just a remnant from me trying Integer.divideUnsigned, but I realised I can have >>>

s[0]^=(0x9e377900|r); (at the very end) -- can't you drop the extra parentheses?

Same with s[4+c]>>>(23).

You can make far fewer changes and get 300: void P(int[]S,int a,int b){int x=S[a];S[a]=S[b];S[b]=x;}void gimli(int[]S){for(int r=24,c,x,y,z;r>0;S[0]^=y<1?0x9e377901+r:0){for(c=4;c-->0;){x=S[c]<<24|S[c]>>>8;y=S[c+4]<<9|S[c+4]>>>23;z=S[c+8];S[c]=z^y^8*(x&y);S[c+4]=y^x^2*(x|z);S[c+8]=x^2*z^4*(y&z);}y=r%4;if(--r%2>0){P(S,0,1+y/2);P(S,3,2-y/2);}}} . I've basically made the minimal changes necessary to get it to compile. Java's precedence rules aren't very different to C's.

Order of Operations

238

JavaScript (ES6), 231 bytes
s=>{for(r=25;--r;[a,b,c,d,...e]=s,s=r&1?s:r&2?[c,d,a,b,...e]:[b,a,d,c,...e],s[0]^=r&3?0:0x9e377900|r)for(c=4;c--;x=s[c]<<24|s[c]>>>8,y=s[j=c+4]<<9|s[j]>>>23,z=s[c+8],s[c+8]=x^z*2^(y&z)*4,s[j]=y^x^(x|z)*2,s[c]=z^y^(x&y)*8);return s}

Demo

let f =

s=>{for(r=25;--r;[a,b,c,d,...e]=s,s=r&1?s:r&2?[c,d,a,b,...e]:[b,a,d,c,...e],s[0]^=r&3?0:0x9e377900|r)for(c=4;c--;x=s[c]<<24|s[c]>>>8,y=s[j=c+4]<<9|s[j]>>>23,z=s[c+8],s[c+8]=x^z*2^(y&z)*4,s[j]=y^x^(x|z)*2,s[c]=z^y^(x&y)*8);return s}

console.log(
  f([
    0x00000000, 0x9e3779ba, 0x3c6ef37a, 0xdaa66d46,
    0x78dde724, 0x1715611a, 0xb54cdb2e, 0x53845566,
    0xf1bbcfc8, 0x8ff34a5a, 0x2e2ac522, 0xcc624026
  ])
  .map(x=>(x >>> 0).toString(16)).join(' ')
)

32-bit x86 assembler (112 bytes)
(__cdecl calling convention)
            pusha
            mov     ecx, 9E377918h
    loc_6:  mov     esi, [esp+24h]
            push    esi
            push    4
            pop     ebx
    loc_E:  lodsd
            ror     eax, 8
            mov     ebp, [esi+0Ch]
            rol     ebp, 9
            mov     edx, [esi+1Ch]
            push    eax
            push    ebp
            lea     edi, [edx+edx]
            and     ebp, edx
            shl     ebp, 2
            xor     edi, ebp
            xor     eax, edi
            mov     [esi+1Ch], eax
            pop     ebp
            pop     eax
            push    eax
            push    ebp
            xor     ebp, eax
            or      eax, edx
            shl     eax, 1
            xor     ebp, eax
            mov     [esi+0Ch], ebp
            pop     ebp
            pop     eax
            xor     edx, ebp
            and     eax, ebp
            shl     eax, 3
            xor     edx, eax
            push    edx
            dec     ebx
            jnz     short loc_E
            pop     esi
            pop     ebp
            pop     ebx
            pop     eax
            pop     edi
            mov     dl, cl
            and     dl, 3
            jnz     short loc_5B
            xchg    eax, ebx
            xchg    esi, ebp
            xor     eax, ecx
    loc_5B: cmp     dl, 2
            jnz     short loc_63
            xchg    eax, ebp
            xchg    esi, ebx
    loc_63: stosd
            xchg    eax, ebx
            stosd
            xchg    eax, ebp
            stosd
            xchg    eax, esi
            stosd
            dec     cl
            jnz     short loc_6
            popa
            retn

Tweetable version (z85-format Base85 encoding):
v7vb1h>C}HbQuA91y51A:oWYw48G)?I=H/]rGf9Na>sA.DWu06{6f#TEC^CM:#IeA-cstx7:>!VfVf#u*YB&mP(tuCl*+7eENBP)$:)Lh!k}t$^wM51j%LDf$HMAg2bB^MQP


text:
Weird grading system
Weirdo Incorporates have a weird way of grading their staffs by the number of days they were present in the office:
  0 -  13 : F
 14 - 170 : E
171 - 180 : D
181 - 294 : C
295 - 300 : B
301 - 365 : A

Note: The range is inclusive (i.e. 0-13 means 0 days and 13 days both will evaluate
as grade 'F').

Objective:
Write a program/function that outputs/returns the grade of an employee for the number of days [within inclusive range of 0-365] attended by the employee.
Rules:

You may take input as a string or a number but must output as a string/alphabet (You may choose either lower or upper-case.)
Standard loopholes apply.
This is code-golf, so the shortest program in bytes wins!

Test cases:
12  => F
15  => E
301 => A
181 => C

Scoreboard:

var QUESTION_ID=142243,OVERRIDE_USER=8478;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){var F=function(a){return a.lang.replace(/<\/?a.*?>/g,"").toLowerCase()},el=F(e),sl=F(s);return el>sl?1:el<sl?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

sandbox

Closely related

Not sure if it is a duplicate, since the strings there are much longer.

Closer related

Will we get input over 365?

@Mr.Xcoder I recall that it was discussed in the sandbox that it's not a dupe of that since this doesn't have equal-sized ranges and that having suffixes such as +/-.

@EriktheOutgolfer Ok. Retracted

@EriktheOutgolfer The input will be less than 366.

Can we get a scoreboard?

@jrtapsell Added

The fact that the test cases don't spell FACE annoys me more than it should.

Jelly,  18 17 15  14 bytes
NịØAx“A©r½ɗÇ‘¤

A monadic link taking a number and returning a character.
Try it online! or see all input-output pairs.
How?
NịØAx“A©r½ɗÇ‘¤ - Link: number, d
N              - negate d
             ¤ - nilad followed by link(s) as a nilad:
  ØA           -   uppercase alphabet yield = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
     “A©r½ɗÇ‘  -   code-page indices = [65,6,114,10,157,14]
    x          -   times = 'A'x65+'B'*6+'C'x114+'D'x10+'E'*157+'F'*14
 ị             - index into (1-indexed & modular - hence the negation to allow all Fs
                                                   to be together at one end)

Javascript (ES6), 51 bytes
n=>"ABCDEF"[(n<14)+(n<171)+(n<181)+(n<295)+(n<301)]

Alternative solutions (longer):
53 52 bytes (-1 byte thanks to @Arnauld)
n=>"FEDCBA"[n>300?5:n>294?4:n>180?3:n>170?2:+(n>13)]

55 53 bytes (-2 bytes thanks to @Neil)
n=>"AFEDCB"[[14,171,181,295,301].findIndex(m=>n<m)+1]

55 bytes
n=>"FEDCBA"[[13,170,180,294,300].filter(m=>n>m).length]

Example code snippet:

f=
n=>"ABCDEF"[(n<14)+(n<171)+(n<181)+(n<295)+(n<301)]
console.log(f(12))
console.log(f(15))
console.log(f(301))
console.log(f(181))

That summing the conditions thing is great!!! Wish I could upvote once again!!! :D

I can save two bytes on one of your alternative solutions: n=>"AFEDCB"[[14,171,181,295,301].findIndex(m=>n<m)+1]

-1 byte for your first alternative solution: n=>'FEDCBA'[n>300?5:n>294?4:n>180?3:n>170?2:+(n>13)]

TI-Basic, 40 bytes
sub("FEDCBA",sum(Ans≥{0,14,171,181,295,301}),1

J, 31 bytes
'FEDCBA'{~13 170 180 294 300&I.

Try it online!
Explanation
'FEDCBA'{~13 170 180 294 300&I.  Input: n
          13 170 180 294 300     Constant array [13, 170, 180, 294, 300]
                            &I.  Use it with interval index to find which of
                                 the intervals (-∞, 13], (13, 170], (170, 180],
                                 (180, 294], (294, 300], (300, ∞) n can be inserted at
        {~                       Index into
'FEDCBA'                         This string and return that char

First time I've seen dyadic I. in the wild. Neat.

@cole I believe I've used it a couple times in the past in code-golf.

Python 3, 50 bytes
Thanks to @jferard for -4 bytes.
lambda n:chr(70-sum(n>ord(x)for x in"\rª´ĦĬ"))

Try it online!
Python 3, 54 bytes
lambda n:chr(70-sum(n>x for x in[13,170,180,294,300]))

Try it online!
Saved 2 bytes thanks to @mathmandan, and indirectly thanks to @JonathanFrech.
Python 2, 56 bytes
lambda n:"ABCDEF"[sum(n<x for x in[14,171,181,295,301])]

Try it online!

54 bytes: lambda n:chr(70-sum(n>x for x in[13,170,180,294,300])).  (See answer by @Jonathan Frech at https://codegolf.stackexchange.com/a/142244/36885)

50 bytes

ruby port: ->n{(70-"ĬĦ´ª\r".chars.count{|i|n>i.ord}).chr} same size

C, 62 61 bytes
Thanks to @Jonathan Frech for saving a byte!
f(n){putchar(70-(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5));}

Try it online!
C, 57 bytes
#define f(n)70-(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5)

Try it online!
C (gcc), 54 bytes
f(n){n=70-(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5);}

Try it online!
C (gcc), 50 bytes
Using @Herman Lauenstein's solution.
f(n){n=65+(n<14)+(n<171)+(n<181)+(n<295)+(n<301);}

Try it online!

61 bytes.

Why not submit the shortest version as your main solution?

@Shaggy The ones that require gcc resort to undefined behaviour, so I'd rather keep the well defined ones on the top, and sorting them from oldest to newest and at the same time from longest to shortest seems fine to me.

Japt, 23 21 bytes
'Gc-[#ªT#´D294L*3]è<U

Try it

Explantion
Implicit input of integer U.
'Gc-

Subtract from the codepoints of the (single character) string G ...
èc(13,170,180,294,300))]

Try it online!
same as the javascript answer, but uses R's vectorization and LETTERS builtin to come in a tiny bit shorter.
Thanks to rturnbull for shaving off those last 6 bytes.

49 bytes

In fact, 44 bytes by just making it a full program instead of a function.

@rturnbull ah, I was about to say "no you need to wrap that in cat or else use source(program,ec=T) and count ec=T as a flag (as per the meta consensus on R programs), but by another, newer meta consensus we don't count flags any longer, so I that's a perfectly valid solution.

Kotlin, 56 bytes
{v->'F'-listOf(13,170,180,294,300).filter{it<v}.count()}

Try it online!
Beautified
{ v->
    // Count the grades passed, then subtract that from F
    'F' - listOf(13,170,180,294,300)
            .filter { it < v }
            .count()
}

Test
var x:(Int)->Char =
{v->'F'-listOf(13,170,180,294,300).filter{it<v}.count()}

fun main(args: Array<String>) {
    println(x(12))
    println(x(15))
    println(x(301))
    println(x(181))
}

+1. I edited your answer to a more formal format, hope you won't mind.

Not at all, I meant to fix my tool to output the right header

Python 2, 77 bytes
lambda n:chr(70-sorted(_*(n>(0,13,170,180,294,300)[_])for _ in range(6))[-1])

Try it online!

Recursiva, 49 30 bytes
Y(++++<a301<a295<a181<a171<a14

Try it online!
Allow me to answer my own question in my own language. :D

saved 19 bytes by using technique from @Herman Lauenstein's amazing JS answer

Explanation:
Y(++++<a301<a295<a181<a171<a14
      <a301<a295<a181<a171<a14 calculate true/false for all the conditions
  ++++                         sum up all the conditions to obtain n which can be either 0,1,2,3,4 or 5
 (                             yield upper-case Alphabet
Y                              Get n-th element

Perl 5, 47 + 1 (-p) = 48 bytes
$_=((F)x14,(E)x157,(D)x10,(C)x114,(B)x6)[$_]||A

Try it online!

Command line flags are free now!

Pyke, 28 bytes
G6<13T17*180T30*294]5FhQ>)s@

Try it here!
Explanation
G6<13T17*180T30*294]5FhQ>)s@ - Full program. T is the constant for 10.

G                            - The lowercase alphabet.
 6<                          - With the letters after the index 6 trimmed.
   13                        - The literal 13.
     T17*                    - The integer 170, composed by 17 * 10, to save whitespace.
         180                 - The literal 180.
            T30*             - The integer 300, composed by 30 * 10.
                294          - The literal 294.
                   ]5        - Create a list of 5 elements.
                     FhQ>)   - For each element in the list.
                      h      - Increment.
                       Q     - The input.
                        >    - Is smaller ^^ than ^? Yields 1 for truthy and 0 for falsy.
                         )s  - Close loop and sum.
                           @ - Get the index in the alphabet substring explained above.

Jelly, 19 bytes
“n-'‘+⁹;“ỌẠÇ‘ð>SịØA

Try it online!
Footer executes all test-cases and formats the output.

Pyth, 30 bytes
@GtlfgTQmCdc"\r ª ´ & , m"d

The site doesn't seem to show the character with code point 1, so you need to insert a character with code point 1 before the &, ,, and m at the end
(Replace all 1s with character with code point 1):
@GtlfgTQmCdc"\r ª ´ 1& 1, 1m"d

Pyth, 25  26  bytes
@<G6sgRQ[13*17T180*30T294

Verify all the test cases.
Explanation
@<G6sgRQ[13*17T180*30T294 - Full program.

  G                       - The lowercase alphabet.
 < 6                      - With the letters after the index 6 trimmed. We will call "S".
        [                 - Initialise a list literal.
         13               - The literal 13.
           *17T           - The integer 170, composed by 17 * 10, so save whitespace.
               180        - The literal 180.
                      294 - The literal 294.
                  *30T    - The integer 300, composed by 30 * 10.
     gRQ                  - For each element, return 1 if is is ≥ the input. 0 otherwise.
    s                     - Sum.
@                         - Get the index into S of ^.
                          - Output implicitly.

Ly, 74 bytes
n(14)L["F"o;]p(171)L["E"o;]p(181)L["D"o;]p(195)L["C"o;]p(301)L["B"o;]"A"o;

Try it online!
A simple if-chain approach. I doubt it can be made much shorter.

Are those paranthesis (...) required? P.S. nvm,  Apparently they are.

Bash, 55 bytes
echo obase=16\;10 $[$1<{14,171,181,295,301}]|tr \  +|bc

Try it online or Verify test cases.

Java 8, 55 bytes
n->n<14?'F':n<171?'E':n<181?'D':n<295?'C':n<301?'B':'A'

Try it here.
Alternative 57 bytes:
n->(char)(n<14?70:n<171?69:n<181?68:n<295?67:n<301?66:65)

Try it here.
Alternative 60 bytes:
n->"FEDCBA".charAt(n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5)

Try it here.
Maybe some kind of formula can be find to get 0-5 in a shorter way than n<14?0:n<171?1:n<181?2:n<295?3:n<301?4:5 using the last approach. Still investigating this.

Excel, 53 bytes
Sum of conditions, then returns the required ASCII character:
=CHAR((A1<14)+(A1<171)+(A1<181)+(A1<295)+(A1<301)+65)

Alternative solutions:
Summing conditions, return string index (63 bytes):
=MID("ABCDEF",(A1<14)+(A1<171)+(A1<181)+(A1<295)+(A1<301)+1,1)

PowerShell, 59 bytes
(,'F'*14+,'E'*157+,'D'*10+,'C'*114+,'B'*6+,'A'*65)["$args"]

Try it online!
Similar-ish to Jonathan Allen's Jelly answer, in that we're constructing an array of all the letters concatenated together, then indexing into that array with the input $args.

Rabbit~, 50 bytes
(Noncompeting, postdates question. I just finished the interpreter(yay) and wanted to try and solve something. This is also my first code golf thing ever)
=>FEDCBA$<({.0-\_-^\-&^?n&&}_}\>\{{\>:.¤})Ð"ỤṅỌrḲA

It basically takes the differences from one grade to the next 14,157,10,114,6,65 (encoded as ỤṅỌrḲA) and subtracts from the input. If a negative number is found it stops progressing along the 'FEDCBA' sequence and outputs the letter.
Small explanation of this beautiful piece of syntax
Rabbit~ uses a grid based memory with one or several carets you can move around; this solution  uses 2.
=>FEDCBA$<({.0-\_-^\-&^?n&&}_}\>\{{\>:.¤})Ð"ỤṅỌrḲA - Full program.

  FEDCBA                                           - Load bytes into grid
                                          Ð"ỤṅỌrḲA - Load bytes 14,157,10,114,6,65 into second line of data grid
=                                                  - Read input
 >       <      _ ^   ^     _  >   >               - Move caret (most instructions read from the grid below the active caret)
        $                                          - Create a new caret
          (                              )         - Loop
           {.0             } }   {{     }          - Conditional statement checking if value at caret == 0 then move active caret to next grade else print and quit
              -  -  -                              - Subtract
               \   \          \ \                  - Cycle active caret
                     &   &&                        - Bitwise and to see if number is negative
                       ?n                          - Get negative sign bit
                                    :.             - Print value at caret as character
                                      ¤            - Terminate program

Nice. Is there a way to try it online?

Not at the moment ^^

Jotlin, 48 41 bytes
{v->'F'-l(13,170,180,294,300).f{a<v}.l()}

Whole program:
var x:(Int)->Char =
{v->'F'-l(13,170,180,294,300).f{a<v}.l()}

println(x(12))
println(x(15))
println(x(301))
println(x(181))

Ported my previous Kotlin answer here.

V, 37 34 bytes
aFEDCBA5äh113äh9äh156äh13ähÀ|vyVp

Try it online!
Hexdump:
00000000: 3133 4146 1b31 3536 4145 1b39 4144 1b31  13AF.156AE.9AD.1
00000010: 3133 4143 1b35 4142 1b36 3441 411b eec0  13AC.5AB.64AA...
00000020: 7c76 7956 70                             |vyVp

Basic idea:

Print FEDCBA, create 5 copies of B, 113 copies of C etc. resulting in the string FFFFFFFFFFFFFEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEDDDDDDDDDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBA (There is probably a more efficient way to do this)
Go to nth column (n is the first argument), copy a single character and replace the entire string with it.

05AB1E, 19 bytes
•5r¥[‚=€®•3ô›_ASsÏ¤

Try it online!

Perl 6, 42 39 bytes
{chr(65+[+] "\rª´ĦĬ".ords »>»$_)}

Stax, 18 bytes
5"«µħĭ",+|oH-VA@]

Run and debug online!
Explanation
Bytes counted in CP437.
5"«µħĭ",+|oH-VA@]
5            -        5 minus the result of the following
 "«µħĭ"                   [14, 171, 181, 295, 301]
        ,+                Append input
          |oH             Index of last element if the array were to be sorted
              VA@]    Letter in the alphabet with the given index

K (oK), 30 bytes
Solution:
"FEDCBA"@0 14 171 181 295 301'

Try it online!
Explanation:
Index into the correct bucket:
"FEDCBA"@0 14 171 181 295 301' / the solution
         0 14 171 181 295 301' / bin (') input in a bucket
"FEDCBA"@                      / index (@) into "FEDCBA"

Excel, 49 bytes
=MID("FEDCBA",MATCH(A1,{0;14;171;181;295;301}),1)
just taking advantage of the MATCH function's default match type behaviour but i'm sure there's a shorter answer
if someone has more experience with excel, please comment any ways i can improve this answer!

C#, 110 bytes
x=>{if(x<14)return"F";if(x<171)return"E";if(x<181)return"D";if(x<295)return"C";if(x<301)return"B";return"A";};

Try it online

You can shorten your lambda significantly using the trinary operator ?: as x<14?"F":x<170?"E":x<180?"D":x<294?"C":x<300?"B":"A"

Thunno, 19 bytes
"\rª´ĦĬ"O>S70_C

Attempt This Online!
Uses the same method as quite a few other answers.
Explanation
"\rª´ĦĬ"O>S70_C    # Implicit input
"\rª´ĦĬ"O          # Push the list [13, 170, 180, 294, 300]
         >         # Check if the input is greater than these numbers
          S        # Sum the resulting list
           70_     # Subtract the sum from 70
              C    # And this codepoint into a character
                   # Implicit output

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


text:
I'm symmetric, not palindromic!
Background
Inspired by I'm a palindrome. Are you?, where it is presented the shocking fact that “()() is not a palindrome, but ())(”, I asked myself what instead is ()() and the answer is simply: it is a string with a vertical symmetry axis!
The task
Write a program or function that takes a string S (or the appropriate equivalent in your language) as input, checks for symmetry along the vertical axis, and returns a truthy or falsy value accordingly. You can use any reasonable means to take the input and provide the output.
Reflectional symmetry
Reflectional symmetry around a vertical axis (or left-right symmetry) means that if you put a mirror vertically at the exact center of the string, the reflected image of the first half of the string is identical to the second half of the string.
For example, the following strings are reflectional symmetric around a vertical axis:
()()
()()()
[A + A]
WOW ! WOW
OH-AH_wx'xw_HA-HO
(<<[[[T*T]]]>>)
(:)
)-(
())(()
qpqp

while the following are not:
())(
((B))
11
+-*+-
WOW ! wow
(;)
qppq

Rules of the contest
• Your program or function will receive only printable ASCII characters. You can include or not the empty string, (which is symmetric, of course!) as legal input, which is better for you.
• The ASCII characters that can be considered symmetric with respect to the vertical axes are the following (note the initial space, and the difference between uppercase and lowercase letters):
 !"'+*-.:=AHIMOTUVWXY^_ovwx|

The ASCII characters that can be considered “mirrored” and their corresponding characters are:
()<>[]{}qpbd/\

Note that, since they are mirrored, you can have both () as well as )(, /\ and \/, etc.
All the other ASCII printable characters must be considered asymmetric and without a mirrored corresponding character.
• This is a code-golf challenge: the shorter your program is, measured in bytes, the better, in any programming language.
• Kudos to people that will produce a symmetric program!
Note: this question is not a duplicate of "Convenient Palindrome”, that requires to check for palindromic strings in which parentheses are flipped. This question is different for two reasons:
1) it is a restriction of the other question for what concerns non-parentheses characters, since only symmetric characters can appear in reverse order.
2) Since it is based on the concept of symmetry, and not on a concept of “convenient palindrome”, mirrored characters can appear in both order, i.e. [] and ][, and this makes the program to solve it different from programs that solve the other problem.

Just for anybody wondering, Charcoal doesn't reflect letters. :(

I disagree with the dupeyness, as the dupe target does not reflect letters and this does.

Sorry, I missed the examples, my mistake

Why isn't 8 considered "symmetric"?

@ScottMilner oh sorry I added qp and db in the sandbox but failed to notice the lack of 8 (and 0 for that matter) :(

@JonathanAllan Well, 0 is debatable, since it is slashed in lots of monospace fonts.

@Stephen I don't see why this should not be a dupe just because more characters are required to be supported.  It is essentially the same task as the other question.

@FunkyComputerMan It's not essentially the same as the dupe target at all. First and foremost this has no source code restriction.

@Renzo - FYI that question does allow both [...] and ]...[ reflection.

Well, I learned today that Ruby's .tr only handles "" when it's at the end of  an argument string...

JavaScript (ES6), 130 125 113 bytes

f=
s=>s==[...s].reverse(s=`()<>[]{}qpbd/\\`).map(c=>s[s.indexOf(c)^1]||/[- !"'+*.:=AHIMOT-Y^_ovwx|]/.exec(c)).join``
<input oninput=o.textContent=f(this.value)><pre id=o>

Edit: Saved 5 bytes thanks to @Arnauld. Saved a further 11 bytes thanks to @YairRand.

Could you use a regexp instead of includes()? Such as /[- !"'+*.:=AHIMO^_ovwx|T-Y]/.test(c).

@Arnauld Indeed, that range is very helpful, thanks!

You can golf [...s].reverse().map(...) to: s::[].map().reverse() if you are ok with using new ES-next features. link

@Downgoat Do you have a link to the spec of that feature?

@Neil here

You can save 11 bytes by moving things around a bit: s=>s==[...s].reverse(s=`()<>[]{}qpbd/\\`).map(c=>s[s.indexOf(c)^1]||/[- !"'+*.:=AHIMOT-Y^_ovwx|]|/.exec(c)).join``

@YairRand Actually it seems that I don't even need the |, so saving yet another byte. Thanks!

Jelly,  69   62 bytes
“(<[{qb/“ !"'+*-.:=AHIMOTUVWXY^_ovwx|“)>]}pd\”,Ṛ$F©f@ð®œs2¤yU⁼

Try it online!
All test cases
-7 bytes thanks to @JonathanAllan
How it Works
“(<[{qb/“ !"'+*-.:=AHIMOTUVWXY^_ovwx|“)>]}pd\”,Ṛ$F©f@ð®œs2¤yU⁼  main link

“(<[{qb/“ !"'+*-.:=AHIMOTUVWXY^_ovwx|“)>]}pd\”  The literal list of strings  ['(<[{qb/', ' !"\'+*-.:=AHIMOTUVWXY^_ovwx|', ')>]}pd\\']
               $                 Last two links (if not part of an LCC) as a monad
            Ṛ                    Reverse array Does not vectorize.
           ,                     Pair; return [x, y].
                 ©               Copy link result to register (® atom to retrieve).
              F                  Flatten list.
                  f              Filter; remove the elements from x that are not in y.
                   @             Swaps operands.

                    ð            Start a new dyadic chain
                         ¤       Nilad followed by links as a nilad.
                      2          The literal integer 2
                   ®             Restore; retrieve the value of the register. Initially 0.
                    œs           Split x into y chunks of similar lengths.
                          y      Translate the elements of y according to the mapping in x.
                           U     Upend; reverse an array.
                            ⁼    Equals. Does not vectorize.

Save six bytes using a filter: ¢FiÐ€;1Ạðaµ¢yU⁼ -> ¢Ff@ð¢yU⁼

Save another by using the register (all on one line now): ...}pd\”,Ṛ$Fœs©2Ff@ð®yU⁼

(...although at the same length ...}pd\”,Ṛ$F©f@ð®œs2¤yU⁼ is arguably nicer)

Found another one byte save by only encoding for one of each pair of adjacent ordinals from the symmetric set (edit of deleted comment with better code)

Python 3, 211 208 195 bytes
lambda S,p="()<>[]{}qpbd\/",s=" !\"'+*-.:=AHIMOTUVWXY^_ovwx|":(S==S.translate({ord(s[2*x]):s[2*x+1]for s in(p,p[::-1])for x in range(7)})[::-1])*(~len(S)%2*s[len(S)//2]in s)*(not set(S)-set(p+s))

Saved 13 bytes thanks to Jonathan Allan.

Save 9 bytes: 1. reverse order of slashes so no need to escape; 2. use 2*x and range(7); 3. use multiplication to avoid the >2 test; 4. use bitwise not on the len(S) to avoid the not of not len(S)%2; 5. use the fact that ''in'blah' is True to allow the string multiplication ~len(S)%2*s[len(S)//2]in s.

Save 4 more inlining everything

SOGL V0.12, 88 bytes
"el²┘N!←8mYdDm⁵╔C⅛┌6▼ģη⁷fņ‘;W‽0←}C
l»{Kα}lalh=‽;KCø;{:↔³↔=?"qpbd”⁴²+:GW:2%«H+W}:h=?:CΚ}=

Try it Here!
~24 bytes to add qpbd mirroring and 6 bytes for (x-1 XOR 1) + 1 :/

Kotlin 1.1, 201 199 bytes
{var R="(<[{qb/\\dp}]>)"
var m=HashMap<Any,Any>()
"\"!'+*-.:=AHIMOTUVWXY^_ovwx| ".map{m[it]=it}
R.indices.map{m[R[it]]=R[R.length-(it+1)]}
it.zip(it.reversed()).filter{m[it.first]!=it.second}.none()}

Beautified
{
    var R = "(<[{qb/\\dp}]>)"
    var m = HashMap<Any, Any>()
    "\"!'+*-.:=AHIMOTUVWXY^_ovwx| ".map { m[it] = it }
    R.indices.map { m[R[it]] = R[R.length - (it + 1)] }
    it.zip(it.reversed()).filter { m[it.first] != it.second }.none()
}

Test
var i:(String)->Boolean =
{var R="(<[{qb/\\dp}]>)"
var m=HashMap<Any,Any>()
"\"!'+*-.:=AHIMOTUVWXY^_ovwx| ".map{m[it]=it}
R.indices.map{m[R[it]]=R[R.length-(it+1)]}
it.zip(it.reversed()).filter{m[it.first]!=it.second}.none()}
fun main(args: Array<String>) {
    var GOOD = listOf("()()",
            "()()()",
            "[A + A]",
            "WOW ! WOW",
            "OH-AH_wx'xw_HA-HO",
            "(<<[[[T*T]]]>>)",
            "(:)",
            ")-(",
            "())(()",
            "qpqp")

    var BAD = listOf("())(",
            "((B))",
            "11",
            "+-*+-",
            "WOW ! wow",
            "(;)",
            "qppq")

    GOOD.filterNot { i(it) }.forEach { throw AssertionError(it) }
    BAD.filter { i(it) }.forEach { throw AssertionError(it) }
    println("Test Passed")
}

Can't run on TIO because 1.1 is not supported

You can get it to work on 1.0 by just importing HashMap Try it online!

Would my score be with or without the import?

since the import is only a shim to get it to work on 1.0, where it works on 1.1 as is, so long as the answer specifies 1.1 you'd be scored without the import. I'd put a note in though, just in case someone doesn't know HashMap is (effectively) imported in 1.1 automatically.

Python 2, 182 167 163 162 160 158 bytes
lambda s:s[::-1]==s.translate(m(t+w,w+t),m("","").translate(None," !\"'+*-.:=AHIMOTUVWXY^_ovwx|"+t+w))
from string import*
m=maketrans
t=")>[{/qd"
w="(<]}\pb"

Try it online!
Saved 2 bytes thanks to Jonathan Allan
Explanation
First, we need to build the list of all chars that don't have a symmetric (the char itself : A, ... or another char ( for ), ...):

m("","") returns a string with all the available chars.
m("","").translate(None," \t!\"'+*-.:=AHIMOTUVWXY^_ovwx|"+t+w)) removes from all the available chars the chars that have a symmetric.

Then, we map every char to its symmetric char and remove the chars that don't have a symmetric with s.translate(m(t+w,w+t),<chars that don't have a symmetric>)
If the result equals to the reversed string, we have a symmetric string.

If you move the slashes from the right end of t and w you can forego the escape, e.g. w="(<]{\pb". Save another byte with from string import*;m=maketrans (I personally go for a newline when the ; does not save bytes though). Also you do not need to name the function so long as it is reusable and not recursive, which saves another 2.

Also you do not need to name the function so long as it is reusable and not recursive, which saves another 2 TIO (note: the code you have listed and at your link is 162 bytes)

@JonathanAllan thanks. I had already removed (mentally) the two bytes for f=, but your version is cleaner.

Perl 5, 102 + 1 (-p) = 103 bytes
$_=!/[^ !"'+*.:=AHIMOT-Y^_ovwx|()<>[\]{}qpbd\/\\-]/&&$_ eq reverse y|()<>[]{}qpbd/\\|)(><][}{pqdb\\/|r

Try it online!

Scala, 140 bytes
s.zip(s.reverse).forall(c=>(" !\"'+*-.:=AHIMOTUVWXY^_ovwx|".flatMap(x=>x+""+x)+"()<>[]{}qpbd/\\\\/dbpq}{][><)(").indexOf(c._1+""+c._2)%2==0)

Try it online!


text:
Is it a strong word?
They say that hate is a strong word. I wanted to find out why, so I had a good look at the word.
I noticed that every consonant had a vowel after it. That made it look quite strong to me, so I decided that that's what makes a word strong.
I want to find more strong words, so I'll need a program for it!
Finding strong words
Strong words are words where every consonant (letters in the set BCDFGHJKLMNPQRSTVWXZ) is followed by a vowel (letters in the set AEIOUY). That's it. Nothing else matters.
If the word starts with a vowel, you don't have to worry about any of the letters before the first consonant. If the word has no consonants in it at all, it's automatically a strong word!
Some examples of strong words are agate, hate and you. agate is still a strong word because although it starts with a vowel, every consonant is still followed by a vowel. you is a strong word because it has no consonants.
There is no restriction on length for strong words.
The challenge
Write a program or function that takes a non-empty string as input, and outputs a truthy value if it is a strong word or a falsy value if it is not.
Clarifications

You may decide to take the input in either lowercase or uppercase. Specify which in your answer.
Words will not contain punctuation of any kind. They will only contain plain letters in the set ABCDEFGHIJKLMNOPQRSTUVWXYZ.
Instead of truthy and falsy values, you may choose two distinct and consistent values to return for true and false. If you do this, specify the values you have picked in your answer.

You may alternatively output a falsy value for a strong word and a truthy one for a non-strong word.

Test cases
Input      -> Output
hate       -> true
love       -> true
popularize -> true
academy    -> true
you        -> true
mouse      -> true
acorn      -> false
nut        -> false
ah         -> false
strong     -> false
false      -> false
parakeet   -> false

Scoring
Since this is code-golf, the answer with the least bytes wins!

Sandbox

Is the empty word "" a possible input?

@SilvioMayolo It is not.

@LyricLy If input is "academy" then output should be false, the way I understand the problem. Because 'm' is a consonant.

@Truth-seek And y is considered a vowel, as the spec states.

@LyricLy Am really sorry. My bad.

Apparently, most of the Italian language is pretty strong. :P

@AndreaLazzarotto Well it is strong with both meanings!

a "banana" is full of hate

JavaScript (ES6), 36 28 27 bytes
Saved 1 byte by inverting the result, as suggested by LarsW
Takes input in lowercase. Returns false for a strong word and true for a non-strong word.
s=>/[^aeiouy]{2}/.test(s+0)

How?
We append a 0 (non-vowel) at the end of the input string and look for two consecutive non-vowel characters. This allows us to cover both cases that make a word not strong:

it contains two consecutive consonants
or it ends with a consonant

Test cases

let f =

s=>/[^aeiouy]{2}/.test(s+0)

;[
  "hate", "love", "popularize", "academy", "you", "mouse", "a", "euouae",
  "acorn", "nut", "ah", "strong", "false", "parakeet"
]
.forEach(s => console.log(s + ' --> ' + f(s)))

Why +0, though? It seems to work fine without it

@MatheusAvellar Without the +0, it would return false positives on words ending with a consonant.

I see, without that it can't find 2 consecutive non-vowels if it's the last letter of the word. Smart!

You should be able to omit the ! (two distinct values)

@LarsW Thanks! I didn't notice this rule.

Brief!!!!!!!!!!!

Not sure if, but can't you use $ in the regex instead of the +0?

@Charlie I don't think there's a way to match an end of input within a []. And all other regex-only methods I can think of are much longer.

@Arnauld echo -e "aba\nabc\nabca\nabac" | grep -E '[^aeiouy$]{2}' seems to yield only abc and abca

@Charlie Yes. Inside a character set, a $ is just a standard character.

Python 2, 48 bytes
lambda s:'se, F'in`[v in'aeiouy'for v in s+'b']`

An unnamed function taking a (lowercase) string, s, and returning False if strong or True if not.
Try it online! (inverts the results to match the OP)
How?
Non-strong words have either a consonant followed by a consonant or end in a consonant.
The code adds a consonant to the end (s+'b') to make the required test be just for two consonants in a row.
It finds out if each letter in the altered word is a vowel with the list comprehension [v in'aeiouy'for v in s+'b'].
It now needs to check for two False results in a row (signalling a non-strong word), it does so by getting a string representation (using `...`) of this list and looking for the existence of 'se, F'. This is the shortest string found in 'False, False' but none of: 'True, True'; 'False, True'; or 'True, False'.
As an example consider 'nut', the list comprehension evaluates each letter, v, of 'nutb' for existence in 'aeiouy' yielding the list [False, True, False, False], the string representation of this list is '[False, True, False, False]' which contains 'e, F' here: '[False, True, Fals>>e, F<<alse]' hence the function returns True meaning that nut is not a strong word.

Jelly,  10  9 bytes
e€ØY;Ạ11ẇ

A monadic link taking a list of characters and returning:

0 if strong
1 if not

Try it online! or see the test-suite.
How?
e€ØY;Ạ11ẇ - Link: list of characters, s      e.g. "hate"  or  "you"  or  "not"
  ØY      - consonant yield                   "BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz"
e€        - exists in? for €ach letter            [1,0,1,0]   [0,0,0]    [1,0,1]
     Ạ    - all truthy? (1 for any valid input)   1           1          1
    ;     - concatenate                           [1,0,1,0,1] [0,0,0,1]  [1,0,1,1]
      11  - literal eleven
        ẇ - sublist exists?                       0           0          1
          -  N.B.: left of ẇ implicitly makes digits so it looks for the sublist [1,1]

Note: The reason for using Ạ is just to save a byte over using 1 (since we then want to use 11 straight away).

hmm, consistent values...

what do you mean?

the hacky Ạ thing in your code...otherwise you could've done e€ØY;1w11 or something

Why eleven? String words didn't seem to be tied to the number eleven in any way

@hyiltiz when the dyad ẇ has a left argument that is a number it gets implicitly converted to a decimal list of digits, so the eleven becomes [1,1].

R, 43 bytes
function(s)grep("[^aeiouy]{2}",paste(s,""))

Try it online!
A port of Arnauld's JavaScript answer; returns 1 for weak words and integer(0) for strong ones; it appends a  (space) to the end of the string.
This is actually vectorized; with a vector of strings, it returns the indices (1-based) of the weak words.

Same comment here, can't you use $ in the regex instead of adding a space?

@Charlie I'm not sure how you intend on using $, care to explain that further?

Like this solution a lot. I think the logic is clearer (and bytes the same) with paste0(s,0), but that is just quibbling.
I think @Charlie is referencing something like this:
grep("[^aeiouy]([^aeiouy]|$)",s)

05AB1E, 8 bytes
Code
žPS¡¦õÊP

Uses the 05AB1E encoding. Try it online!
Explanation
žPS¡         # Split the string on consonants (bcdfghjklmnpqrstvwxz)
    ¦        # Remove the first element of the array to handle cases when the
               string starts with a consonant
     õÊP     # Check if the empty string is not in the array

Example
             # "popularize"
žPS¡         # ['', 'o', 'u', 'a', 'i', 'e']
    ¦        # ['o', 'u', 'a', 'i', 'e']
     õÊ      # [1, 1, 1, 1, 1]
       P     # 1

Maybe I'm missing something, but this seems to always return 1? It returns 1 for both the truthy cases I tried and the falsey testcases.

(Oh, I just noticed how old this answer (and question) is. I guess something in the language has changed in the meantime?)

@sundar Yes nice catch! It seems that I broke the split function at some point. I will fix this as soon as possible.

Dyalog APL, 20 bytes
⎕←∧/2∨/0,⍨⍞∊'aeiouy'

Try it online!

I don't think you need ⎕←.

@Zacharý I used not to put it, but I was later told (by Dennis, I believe) that a program should not assume to be run in a REPL.

What language did he tell you that about? Was it for Dyalog APL? I know that policy definitely applies for Python/JavaScript/etc.

Haskell, 61 54 bytes
f=and.(zipWith(||)=<<tail).(map(`elem`"aeiouy")).(++"z")

Try it online!
I had to add a z at the end of the string to handle the case of a trailing consonant.

Husk, 12 bytes
ΛΣX_2m€¨γaıu

Try it online!
Thanks to H.PWiz for help with -4. Returns inconsistent but appropriately truthy or falsy values.
Thanks to Leo for -1, now returns consistent truthy/falsy value.

Shorter compressed string. String compression is still way too slow, I need to work on it some more

@Leo I think that's an NP problem unfortunately.

Java (OpenJDK 8), 93 81 bytes
s->{int w=0,p=w,l;for(char c:s)w|=p&(p=l="aeiouy".indexOf(c)>>31);return w+p>=0;}

Try it online!

I'm afraid booleans are not the answer: s->{int w=0,p=w,l;for(char c:s){l="aeiouy".indexOf(c)>>31;w|=p&l;p=l;}return w+p>=0;}.

Or you can even do this: s->{int w=0,p=w,l;for(char c:s)w|=p&(p=l="aeiouy".indexOf(c)>>31);return w+p>=0;}

Nice answer, but with this challenge a simple regex-matching is actually quite a bit shorter. Still, +1 from me.

@KevinCruijssen My regex is awful, couldn't get it to work :D. I will pretend that I wanted to be original

@RobertoGraham "I will pretend that I wanted to be original" Well, it certainly is. :) And I used to be pretty bad at regex as well, but after quite a few other answers here on PPCG using regex I'm getting more used to it. And I had already figured out how to match consonants using [a-z&&[^aeiouy]] in a previous answer of mine. ;)

Pyth, 18 bytes
:+Q1."2}M>åYà

Verify all the test cases.
"Borrowed" the regex from the JS answer. This returns False for strong words, True otherwise

@KevinCruijssen In fact, Pyth uses ISO-8859-1. That's why I am not convinced.

@KevinCruijssen Downgoat's userscript tells me it is 13 bytes: 13 ISO-8859-1 bytes, 13 chars. I think that should be fine

@KevinCruijssen Should be fixed now.

@KevinCruijssen I don't see any difference. What is code do you see in my answer and what code do you see in my testing link?

@KevinCruijssen Lol, it's your browser's font.

Ruby, 25 bytes
->w{w+?t!~/[^aeiouy]{2}/}

Try it online!
Everybody else is doing it, so why can't Ruby?

Brachylog, 18 11 10 bytes
,Ḷs₂{¬∈Ẉ}ᵐ

Try it online!
Neat and simple (except maybe for the 2 extra initial bytes to handle the final consonant case, like "parakeet").
Is falsey for strong words and truthy for non-strong words.
,Ḷ               % append a newline (non-vowel) at the end of input,
                 %   to catch final consonants
     s₂          % the result has some substring of length 2
       {¬∈Ẉ}ᵐ    % where neither of its elements belong to
                 %   the set of alternate vowels (with "y")

Jelly, 11 bytes
e€ØY;1a2\¬Ȧ

Try it online!
e€ØY;1a2\¬Ȧ  Main link
 €           For each letter
e            Is it an element of
  ØY         The consonants (excluding Yy)?
    ;1       Append 1 (true) (consonant) to make sure last letter isn't consonant
       2\    For all (overlapping) slices of length 2 (the <link><nilad>\ functionality)
      a      Logical AND of the two values; is it a consonant pair?
         ¬   Logical NOT vectorizing; for each (overlapping) pair, is it not a consonant pair?
          Ȧ  Any and all; make sure all pairs are not consonant pairs

Yes I know I've been beaten a lot by Jonathan Allan but I wanted to share my approach anyway :P
-4 bytes by stealing a little bit of Jonathan Allan's answer (instead of appending a consonant to check for last-letter edge case, just append 1)
-1 byte thanks to miles

You can save a byte using either a2\ or Ȧ2Ƥ instead of ṡ2Ȧ€

@JonathanAllan facepalm I deliberately made sure to use ØC to make sure Yy was counted as a consonant because somehow I remembered backwards. Thanks!

Perl 5, 31 bytes (30 + 1)
$_=''if/[^aeiouy](?![aeiouy])/

+1 byte for -p command line flag. Prints the word if it's a strong word, or the empty string if it is not.

"two distinct and consistent values"

@L3viathan Empty strings are falsy and non-empty strings are truthy. This is valid.

@L3viathan Perl's truthiness rules are actually very conducive to challenges like this. It's not the first time I've exploited that exact fact.

With newline terminated words, this can be shortened to $_=$/if/[^aeiouy]{2}/.

Retina, 23 18 bytes
$
$
1`[^aeiouy]{2}

Try it online! Outputs 0 for strong, 1 if not. Add 1 byte to support mixed case. Edit: Saved 5 bytes thanks to @ovs.

18 bytes by appending a consonant to the end.

Awk, 39 bytes
/([^aeiouy]{2}|[^aeiouy]$)/{print "n"}

prints n for non-strongword, nothing (or, just a newline) for strongword
following the pack and searching for two consecutive non-vowels on lowercase input
testing
$ awk -f strongwork.awk
hate
love
popularize
academy
you
mouse
acorn
n
nut
n
ah
n
strong
n
false
n
parakeet
n

Kotlin, 49 bytes
{Regex(".*[^aeiouy]([^aeiouy].*|$)").matches(it)}

True and false are swapped
Beautified
{
    Regex(".*[^aeiouy]([^aeiouy].*|$)").matches(it)
}

Test
var s:(String)->Boolean =
{Regex(".*[^aeiouy]([^aeiouy].*|$)").matches(it)}
data class TestData(val input: String, val output: Boolean)

fun main(args: Array<String>) {
    val items = listOf(
            TestData("hate", true),
            TestData("love", true),
            TestData("popularize", true),
            TestData("academy", true),
            TestData("you", true),
            TestData("mouse", true),
            TestData("acorn", false),
            TestData("nut", false),
            TestData("ah", false),
            TestData("strong", false),
            TestData("false", false),
            TestData("parakeet", false)
    )

    items
            .filter { s(it.input) == it.output }
            .forEach { throw AssertionError(it.toString()) }

    println("Test Passed")
}

TryItOnline
Based on @Arnauld's Answer

Java 8, 53 42 bytes
s->s.matches(".*[^aeiouy]([^aeiouy].*|$)")

-11 bytes by using the same regex as in @jrtapsell's Kotlin answer instead.
Try it here. (false if strong; true if not)
Explanation:
s->               // Method with String parameter and boolean return-type
  s.matches(      //  Checks if the String matches the following regex:
    ".*           //   One or more characters
     [^aeiouy]    //   Followed by a consonant
     ([^aeiouy].* //   Followed by another consonant (+ any more characters)
      |$)")       //   Or the end of the String
                  // End of method (implicit / single-line return statement)

So it basically checks if we can find two adjacent consonants, or if the String ends with a consonant.

Old answer (53 bytes):
s->s.matches("[aeiouy]*([a-z&&[^aeiouy]][aeiouy]+)*")

Try it here. (true if strong; false if not)
Uses regex to see if the input-String matches the 'strong'-regex. Note that String#matches in Java automatically adds ^...$ to check if the String entirely matches the given regex.
Explanation":
 s->                   // Method with String parameter and boolean return-type
  s.matches(           //  Checks if the String matches the following regex:
    "[aeiouy]*         //   0 or more vowels
    ([a-z&&[^aeiouy]]  //     { A consonant,
     [aeiouy]+)        //       plus one or more vowels }
    *")                //    Repeated 0 or more times
                       // End of method (implicit / single-line return statement)

A search instead of matches (like a lot of other answers use) is actually longer in Java:
70 bytes:
s->java.util.regex.Pattern.compile("[^aeiouy]{2}").matcher(s+0).find()

Try it here. (false if strong; true if not)

Python 2, 58 bytes
-30 bytes by realizing it can be as simple as Arnauld's JS answer.
lambda s:re.search('[^aeiouy]([^aeiouy]|$)',s)<1
import re

Try it online!

Save 6 bytes by really doing the same as Arnauld

Don't you need to assign the lambda to somthing? i.e. f=lambda s...

@OldBunny2800 not unless you are using the reference within your code (it is acceptable to create an unnamed function one could access for reuse with header or footer code - here with f=\ in a header).

I think you might be able to replace your pattern string '[^aeiouy]([^aeiouy]|$)' (24 bytes) with "[^aeiouy]("*2+")|$)" (21 bytes) to save 3 bytes, as the empty group, (), does not change the search behavior (TIO).

@JonathanFrech It can get even better

@Mr.Xcoder Would it not be allowed to remove <1 and save 2 bytes, as the function is not required to output a boolean, but rather two distinct values?

SOGL V0.12, 19 18 bytes
æ"[^ŗy]”ŗ(ŗ|$)”øβ=

Try it Here!
Explanation:
æ                   push "aeiou"
 "[^ŗy]”            push "[^ŗy]" with ŗ replaced with pop
        ŗ(ŗ|$)”     push `ŗ(ŗ|$)` with ŗ replaced with pop
               øβ   replace in the input that regex with nothing
                 =  check for equality with the original input

05AB1E, 11 bytes
žP¹SåJ1«11å

Try it online!
Uses Jonathan's algorithm, returns 0 for true and 1 for false.

C++, 195 194 bytes
-1 bytes thanks to Zacharý
Uppercase, return true if input is a strong word, false otherwise ( C++ have simple int to bool implicit cast rules, 0 => false, true otherwise )
#include<string>
#define C(p)(v.find(e[p])==size_t(-1))
std::string v="AEIOUY";int s(std::string e){for(int i=0;i<e.size()-1;++i)if(e[i]>64&&e[i]<91&&C(i)&&C(i+1))return 0;return!C(e.size()-1);}

Code to test :
auto t = {
    "HATE",
    "LOVE",
    "POPULARIZE",
    "ACADEMY",
    "YOU",
    "MOUSE",
    "ACORN",
    "NUT",
    "AH",
    "STRONG",
    "FALSE",
    "PARAKEET"
};

for (auto&a : t) {
    std::cout << (s(a) ? "true" : "false") << '\n';
}

You can remove the space between return and !.

Swift 3.1, 85 bytes
import Foundation
{($0+"0").range(of:"[^aeiouy]{2}",options:.regularExpression)==nil}

Try it here!
This borrows Arnauld's regex.

Lua, 41 bytes
return#(io.read()..0):match"[^aeiouy]+"<2

Reads from standard input
Lua (loadstring'ed), 37 bytes
return#((...)..0):match"[^aeiouy]+"<2

Reads from function parameter(s)

Input is lowercase
Sees if there is a string of length 2 or more, consisting only of not vowels (consonants) or if the string ends with a non-vowel
Returns true/false

C, 107 Bytes
i,v,w,r,t;a(char*s){w=0;for(r=1;*s;s++){v=1;for(i=6;v&&i;)v=*s^" aeiouy"[i--];r=w&&v?0:r;w=v;}return r&~v;}

Returns 1 for strong word and 0 for weak word. Tested with the words given in the main post.

C (gcc), 59 bytes
f(char*s){return*s?strcspn(s,"aeiouy")+!s[1]<2?f(s+1):0:1;}

Try it online!

PHP, 69 bytes
preg_match("/([^AEIOUY][^AEIOUY]+|[^AEIOUY]$)/",$_SERVER['argv'][1]);

Returns 1 is the word is not strong.

Welcome to PPCG! I believe you can remove spaces to cut some bytes, specifically /", str -> /",str and [1]))) return -> [1])))return but I don't know PHP too well so I can't be sure.

Yes, good idea! Also it is possible to reduce bytes by assuming that input is always in uppercase.

Oh, and if the regex is a standard regex engine, can't you do [B-Z]?

@Stephen [B-Z] includes vowels. [^AEIOUY] works, though.

I don't know PHP either, but you could probably save more bytes by returning the result from the regex match directly, instead of wrapping it in an if statement.

@LyricLy oh I didn't notice the lack of vowels :P

CJam, 57 bytes
q{"aeiouy"#W=}%_,:B{_A={_A_)\B(<{=!X&:X;}{0:X;;;}?}&}fA;X

Try it online!

Reads input, converts to 1s for consonants, 0s for vowels. For every consonant, AND predefined variable X (predefined to 1) with next character's value. Output X

Zsh, 21 bytes
>$1x<*[^aeiouy](#c2)*
Attempt This Online!
Same method everyone else is using. Outputs via exit code: 1 for strong, 0 for not strong. Requires the extendedglob option.


text:
Create an auto-cucumber program

Oops, Auto-correct.

You have a word. But it's wrong. You wonder what word it would be. Thankfully, being a code golfer, You can make a code to take a rough guess.
I/O
You will be given a (wrong, all lowercase) word, and a '(All lowercase)Dictionary list'. You have to output the word with the least Levenshtein distance to the wrong word. If there are multiple words of the same levenshtein distance, use the last one in the list.
Examples
Input => Output
(["apple", "banana", "orange", "pineapple"], "baenanae") => "banana"
(["zeal", "zealot", "zealotry", "zealots", "zealous", "zealously", "zealousness"], "zealousl") => "zealously"
(["abductors", "abducts", "abe", "abeam", "abel"], "") => "abe"

Will the empty string ever be in either part of the input?

This is just a loop around https://codegolf.stackexchange.com/q/67474/194

@PeterTaylor it appears so, yes.

05AB1E, 6 bytes
Σ.L(}¤

Try it online! (note: the trailing newline on the input is necessary for the empty string case.)
How?
Σ.L(}¤ - implicitly push the first input (the dictionary list)
Σ   }  - sort the list by:
       -   implicitly push second input (the misspelled word)
 .L    -   Levenshtein distance
   (   -   negated
     ¤ - tail the sorted list  and place the entry on the top of the stack
       - implicitly print top of stack

Python 3 + pylev, 77 bytes
lambda m,s:min({levenshtein(x,s):x for x in m}.items())[1]
from pylev import*

Try it on repl.it!

Shouldn't that be [-1]? Ah no my bad... what happens with multiple minima?

See my edit above - I assumed you wanted to get the rightmost (as per requirements) but noticed it was getting the second of two values. Try the zealousl example. (possibly for x in m[::-1] will do it)

@JonathanAllan I had missed that part of the spec, but nevertheless the correct answer is always given. If any of the distances are the same, the earlier ones will be overwritten by the later ones, since a dictionary can only have one value for a key.

Oh of course, sweet side-effects Batman :)