text:
Which really big number is bigger?
This question is tricky (and in particular harder than Which big number is bigger?), for those who like more challenging puzzles.
Input
Integers a1, a2, a3, a4, a5,  b1, b2, b3, b4, b5 each in the range 1 to 10.
Output
True if a1^(a2^(a3^(a4^a5))) > b1^(b2^(b3^(b4^b5))) and False otherwise.

^ is exponentiation in this question.
Rules
This is code-golf. Your code must terminate correctly within 10 seconds for any valid input on TIO.  If your language is not on TIO, the code should finish under 10 seconds on your machine.
You can output anything Truthy for True and anything Falsey for False.
Test cases
Recall that by the rules of exponentiaon,  a1^(a2^(a3^(a4^a5))) == a1^a2^a3^a4^a5.
10^10^10^10^10 > 10^10^10^10^9
1^2^3^4^5 < 5^4^3^2^1
2^2^2^2^3 > 10^4^3^2^2
6^7^8^9^10 is not bigger than 6^7^8^9^10
10^6^4^2^2 < 10^6^2^4^2
2^2^2^2^10 > 2^2^2^10^2
10^9^8^7^6 < 6^7^8^9^10
3^1^10^10^10 > 2^1^10^10^10
9^10^10^10^10 < 10^9^10^10^10

New test cases from Kevin Cruijssen
[10,10,10,10,10, 10,10,10,10,9] #true
[2,2,2,2,3,      10,4,3,2,2]    #true
[2,2,2,2,10,     2,2,2,10,2]    #true
[10,10,10,10,10, 9,10,10,10,10] #true
[3,2,2,1,1,      2,5,1,1,1]     #true
[2,2,3,10,1,     2,7,3,9,1]     #true
[7,9,10,10,10,   6,9,10,10,10]  #true
[3,2,2,2,2,      2,2,2,2,2]     #true
[8,3,1,2,1,      2,2,3,1,1]     #true
[2,4,2,1,1,      3,3,2,1,1]     #true
[5,4,3,2,1,      1,2,3,4,5]     #true

[1,2,3,4,5,      5,4,3,2,1]     #false
[6,7,8,9,10,     6,7,8,9,10]    #false
[10,6,4,2,2,     10,6,2,4,2]    #false
[10,9,8,7,6,     6,7,8,9,10]    #false
[1,10,10,10,10,  1,10,10,10,9]  #false
[2,4,1,1,1,      2,2,2,1,1]     #false
[2,2,2,1,1,      2,4,1,1,1]     #false
[2,5,1,1,1,      3,2,2,1,1]     #false
[4,2,1,1,1,      2,4,1,1,1]     #false
[2,4,1,1,1,      4,2,1,1,1]     #false
[2,3,10,1,1,     8,3,9,1,1]     #false
[8,3,9,1,1,      2,3,10,1,1]    #false
[2,4,1,1,1,      3,3,1,1,1]     #false
[2,2,1,9,9,      2,2,1,10,10]   #false
[2,2,1,10,10,    2,2,1,9,9]     #false
[1,1,1,1,1,      1,2,1,1,1]     #false

I'm VTC'ing this, even though it isn't a dupe; it's just too close to a challenge you posted 4 hours prior and shows a lack of effort to think up unique challenges.

@MagicOctopusUrn Can I politely but firmly disagree? a) this question now has this at the top "question may already have an answer here:" which is just completely wrong.  Solutions to the linked question are completely incorrect for this problem. Solutions to this question will be in no way competitive for the linked question.  b) Second, it's not a lack of effort!  There are two completely different questions you can ask on the same topic and I thought that was really interesting. You may not find it interesting but that's a different issue.

I feel like 9 people agreed on my point with their votes; but, as you say, it's your choice to keep it even though it has 9 downvotes. Was just shedding some light on why there may be downvotes.

@MagicOctopusUrn I couldn't delete it even if I wanted to could I?  The question received a number of downvotes before I improved it. For example, I didn't realise there was a restricted-time tag for example which looks perfect for this question.  But however you slice it, "This question may already have an answer here:" is simply factually incorrect.

@MagicOctopusUrn How is it incorrectly used?  I simply copied the model from https://codegolf.stackexchange.com/questions/182202/next-number-with-k-fives .

Was just my two cents man, honestly; we don't need to go into detail here. Regret I even said anything; the last thing I wanted was an argumentative response. I was just stating why I gave a -1.

I'm voting to reopen this post because it has different difficulty parameter and the required approach to solve it is very different. Meta post.

Suggested test cases (for the edge cases encountered by the Python, Ruby, Java, and 05AB1E answers)

Ruby, 150 bytes
See revisions for previous byte counts.
->a,b,c,d,e,f,g,h,i,j{l=->s,t=c{Math.log(s,t)};y,z=l[l[g,b]]-d**e+l[h]*i**=j,l[l[a,f]*b**c,g];a>1?f<2?1:b<2||g<2?z>h:c<2||d<2?l[z,h]>i:y==0?a>f:y<0:p}

-10 bytes thanks to @ValueInk
+16 bytes thanks to @RosLuP for bugs.
Try it online.
Compare different base powers-towers (of 'height' five)?
Ungolfed code:
-> a, b, c, d, e, f, g, h, i, j {
    l =-> s, t = c {Math.log(s, t)}
    i **= j
    y = l[l[g, b]] - d ** e + l[h] * i
    z = l[l[a, f] * b ** c, g]
    if a == 1
        return p
    elsif f == 1
        return 1
    elsif b == 1 || g == 1
        return z > h
    elsif d == 1 || c == 1
        return l[z, h] > i
    elsif y == 0
        return a > f
    else
        return y < 0
    end
}

Code breakdown:
l =-> s, t = c {Math.log(s, t)}

This is the base t logarithm, which will be used to reduce the size of the numbers we are comparing. It defaults to base c when only one argument is given.
i **= j
y = l[l[g, b]] - d ** e + l[h] * i
z = l[l[a, f] * b ** c, g]

This updates i = i ** j since i never gets used on it's own, and y is the result of logging b^c^d^e == g^h^i(^j) twice and moving everything to one side. We then let z = l[a, f] * b ** c as the log base g of the log base f of a ** b ** c.
if a == 1
    return p
elsif f == 1
    return 1

1^b^c^d^e = 1 is never greater than f^g^h^i^j, and likewise, a^b^c^d^e is always greater than 1^g^h^i^j = 1 if a != 1. Note that return p returns nil, which is falsey, and return 1 returns 1, which is truthy.
elsif b == 1
    return z > h

If b == 1 or g == 1, then this reduces to comparing a ** b ** c to f ** g ** h, which is done with two logs to both sides.
elsif d == 1 || c == 1
    return l[z, h] > i

This compares a ** b ** c with f ** g ** h ** i by rearranging it as log[log[b ** c * log[a, f], g], h] compared to i. (Recall that i **= j in the beginning and z = log[b ** c * log[a, f], g].)
elsif y == 0
    return a > f
else
    return y < 0
end

This compares the 4 highest powers after logging both sides twice. If they are equal, it compares the base.

Python 2, 671 612 495 490 611 597 bytes
lambda a,b:P(S(a,b))>P(S(b,a))if P(a)==P(b)else P(a)>P(b)
def S(a,b):
  if a and a[-1]==b[-1]:
    a.pop()
    b.pop()
    return S(a,b)
from math import*
L=log
E=exp
N=lambda m,n,x:N(m,n+1,L(x))if x>=1else N(m,n-1,E(x))if x<0else(m+n,x)
A=lambda a,n,x:(0,1)if a==1else(1,R(x,n)*L(a))if a<1else N(2,*C(L(L(a)),x,n-1))if n else(1,x*L(a))
def C(c,x,n):
 if c*n==0:return(0if c else n,x+c)
 z=R(x,n-1)
 if z<=L(abs(c)):return(0,E(z)+c)
 return N(1,*C(L(1-E(L(-c)-z)if c<0else 1+E(L(c)-z)),x,n-1))
def R(x,n):
 try:exec'x=E(x)'*n
 except:x=float('inf')
 return x
P=lambda b:b and N(0,*A(b[0],*P(b[1:])))or(0,1)

-59 bytes thanks to @EmbodimentOfIgnorance
-117 bytes thanks to @Neil
+121 bytes for about five bug-fixes, all found by @ngn
Takes the inputs as two lists. NOTE: Also works with larger lists or those of unequal length. EDIT: No longer true; it still works if P(a) and P(b) result in different tuples, but if they are the same this updated code above only works with lists with a fixed size of 5 now.
Try it online.
Explanation:
Golfed version of this answer on math.stackexchange.com, so all credit goes to @ThomasAhle.
To quote his answer:

The idea is to represent power towers as a single floating point
  number with \$n\$ exponentiations: \$(x\mid n) := exp^n(x)\$. Normalizing
  \$x\in[0,1)\$, this format allows easy comparison between numbers.
What remains is a way to calculate \$a^{(x\mid n)}\$ for any real,
  positive \$a\$. My Python code below is an attempt to do so, while being
  as numerically stable as possibly, e.g. by using the log-sum trick. My
  code runs in time proportional to the height of the tower (number of
  apow calls) and the iterated-log of it's value (number of recursive
  calls).
I haven't been able to find two towers with values close enough to
  case my method to fail. At least for integer exponents. With
  fractional exponents it is possible to create very towers too close
  for my representation to handle. E.g. \$2^{2^{2^{2^0}}}<2^{2^{2^{2^{(1/2)^{2^{2^{2^2}}}}}}}\$
I would be interested in suggestions to other types of counter
  examples, especially integer ones.
It seems to me that for the problem to be in P, we need to
  non-numerical methods. It doesn't seem unlikely at all, that certain
  analytical cases are harder than P.
Examples:
powtow([2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,2,2,2]) = (0.1184590219613409, 18)
powtow([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9]) = (0.10111176550354063, 18)

powtow([2,2,5,2,7,4,9,3,7,6,9,9,9,9,3,2]) = (0.10111176550354042, 17)
powtow([3,3,6,3,9,4,2,3,2,2,2,2,2,3,3,3]) = (0.19648862015624008, 17)

Counter examples:
powtow([2,2,2,2,2,2,2]) = (0.8639310719129168, 6)
powtow([3,2,2,2,2,2,2]) = (0.8639310719129168, 6)

Regarding the counter examples, he mentions the following in the comment-section:

I believe if we bound the exponents so \$1<a<100\$ (or maybe a much larger upper bound) we can use my method for comparing the height 3 or 4 head of the tower. It should be strong enough to tell us if they are equal or one is larger. Plan B is to choose the highest tower. Plan C is the interesting one: At this point the values of the rest of the tower only matter if the heads are equal, so we can walk down the towers in parallel, stopping as soon as we see a differing value.
Hence the main thing to be proven is that once the head of a tower exceeds a certain point, and the rest of the exponents are bounded (and equally numerous), we can simply look at the top differing value. It's a bit counter intuitive, but it seems very likely from the simple inequalities you get.

Since plan A and B are irrelevant in this challenge, since the height is 5 for both power-towers we input, plan C it is. So I've changed P(a)>P(b) to P(S(a,b))>P(S(b,a))if P(a)==P(b)else P(a)>P(b) with the recursive function S(a,b). If P(a) and P(b) result in the same tuple, the P(S(a,b))>P(S(b,a)) will first remove trailing values which are equal at the same indices, before doing to same P(A)>P(B) check on these now shorter lists.

Thanks! In our case there aren't that many different possible inputs so maybe they can all be checked?

I also suck at golfing in python, but here is a 612 byter

559 bytes based on @EmbodimentofIgnorance's code (also removed footer to fit link in comment box)

495 bytes

@EmbodimentofIgnorance Thanks! Completely forgot about exec'...'*n, and also forgot it's possible creating 'variables' for the log/exp like in C. :)

Fails for [10,10,10,10,10]>[9,10,10,10,10]

@EmbodimentofIgnorance Should be fixed now, thanks. I was afraid there might be some counter-examples where P(a)==P(b) even though the a and b are different and they shouldn't be equal. The linked answer also mentioned the counter-examples [2,2,2,2,2,2,2] and [3,2,2,2,2,2,2] which result in equal tuples. I've fixed this with plan C that he mentioned in the comment section, for which I added a quote and brief explanation at the bottom of my post.

You only use the function R once, so maybe you can just inline it?

https://tio.run/##PVFNj4IwEL33V4wnplgS6pE4JsZwI8bs1fVQsKwYKQTZpHLYv@62Rb304715b16n/WO8dGb1rOn7eVNteVagRJmpBZWgzPnYbK5QdwM04gqNganp0fG8qaFZ0PV0TOTJnQ@oONEBS65vdx2uG39j9dC10KrxAk3bd8MYs4Ju3Q/LSdue7enVshVG2GyPbl9KUaDlvoPdkAx@gUikyN/EOvU4tksn42xLn@TeBlMhfZWiWY5SfKEVhseFyxWY9dt3JeIdFhgIYX2TUGDgJbSzhp11DTusfAnPGLiSKjZEaTbo8XcwmHokiMBFWFacwUSWwTg8Mm11FU2U48Sj@C8xDLStdD9mE9W3To0YNaaOeHCd1uQalnesOP94Cy8NnjPicss5t0xytyYVTyYfu5rnAnLp4YB@XsUO7ymVWfha55KKeIvlMT2J2P3WUWYnznk3hAE@n/8

@EmbodimentofIgnorance There's still an outstanding call to R on line 5...

exec'x=E(x)'*n - this fails for n>1. missing ; after E(x)?

fails for [1,10,10,10,10],[1,10,10,10,9]

@ngn Should be fixed now, as well as cases like [2,2,1,9,9],[2,2,1,10,10]. Can definitely be golfed again, though.. I'm pretty bad at Python golfing tbh.

[1,1,1,1,1],[1,2,1,1,1] raises an IndexError

[2,4,1,1,1],[2,2,2,1,1] - wrong result

@ngn dangit.. >.> Maybe I should have ported this to Java or 05AB1E, then I at least knew what I was doing and could easily fix these kind of issues.. I know what the issue is, will see if I can fix it. Once I've figured out how to properly split an integer-list in Python on a certain value (1) in this case..

you could use a[:(a+[1]).index(1)] to remove the first 1 and everything after it, but i'm not sure the rest of the algorithm is correct

@ngn I think the original algorithm (so P(a)>P(b)) is correct for lists of this size 5, except that I should remove equal pairs from the end of the inputs first. So f([9,10,10,10,10],[10,10,10,10]) would becomes f([9],[10]) and f([2,4,1,1,1],[2,2,2,1,1]) would become f([2,4],[2,2,2]). Unless you find another counter-example. ;) PS: How to accomplish what I stated in this comment? I know how to remove all equal pairs with a zip and zip* back, but I only want to remove the trailing items which are equal.

@KevinCruijssen i don't think that works. consider [2,4,2],[3,3,2] - the first one is bigger (65536>19683), but if we remove the trailing 2s, it's the other way round (16<27)

@ngn Ah, crap, you're right.. Found a fix for that as well. Will update now, and hopefully you won't be able to find any more edge cases, haha. ;P (Read: thanks for finding all these edge cases.)

the follow output of your test program for above is it ok?
Result: False Succeeded:
True  [2, 1, 1, 1, 1] [3, 1, 1, 1, 1]
Result: False  Succeeded:
True  [10, 6, 4, 2, 2] [10, 6, 2, 4, 2]
etc

05AB1E, 96 104 bytes
3èI4èmU8.$`m©I7èI2è.n*I6èI1è.nI2è.n+Vнi0ë5èi1ë2ô1èßi¦2£`mIнI5è.n*I6è.nDI7èDi\1›·<žm*ë.n}®›ëXYQiнI5è›ëXY›

Port of @SimplyBeautifulArt's Ruby answer, so make sure to upvote him!
+8 bytes as work-around, because \$\log_1(x)\$ should result in POSITIVE_INFINITY for \$x\gt1\$ and NEGATIVE_INFINITY for \$x\lt1\$, but results in 0.0 for both cases instead in 05AB1E (i.e. test cases [3,2,2,1,1,2,5,1,1,1] (POSITIVE_INFINITE case) and [2,4,1,1,1,3,3,1,1,1] (NEGATIVE_INFINITY case).
Input as a list of ten integers: [a,b,c,d,e,f,g,h,i,j].
Try it online or verify all test cases.
Explanation:
3èI4èm         # Calculate d**e
      U        # And pop and store it in variable `X`
8.$`m          # Calculate i**j
     ©         # Store it in variable `®` (without popping)
I7èI2è.n       # Calculate c_log(h)
 *             # Multiply it with i**j that was still on the stack: i**j * c_log(h)
I6èI1è.nI2è.n  # Calculate c_log(b_log(g))
 +             # And sum them together: i**j * c_log(h) + c_log(b_log(g))
  V            # Pop and store the result in variable `Y`

нi             # If `a` is 1:
 0             #  Push 0 (falsey)
ë5èi           # Else-if `f` is 1:
 1             #  Push 1 (truthy)
ë2ô1èßi        # Else-if the lowest value of [c,d] is 1:
 ¦2£`m         #  Calculate b**c
 IнI5è.n       #  Calculate f_log(a)
  *            #  Multiply them together: b**c * f_log(a)
   I6è.n       #  Calculate g_log(^): g_log(b**c * f_log(a))
 D             #  Duplicate it
  I7è          #  Push h
     Di        #  Duplicate it as well, and if h is exactly 1:
       \       #   Discard the duplicated h
       1›      #   Check if the calculated g_log(b**c * f_log(a)) is larger than 1
               #   (which results in 0 for falsey and 1 for truthy)
         ·<    #   Double it, and decrease it by 1 (it becomes -1 for falsey; 1 for truthy)
           žm* #   Multiply that by 9876543210 (to mimic POSITIVE/NEGATIVE INFINITY)
      ë        #  Else:
       .n      #   Calculate h_log(g_log(b**c * f_log(a))) instead
      }        #  After the if-else:
       ®›      #  Check whether the top of the stack is larger than variable `®`
ëXYQi          # Else-if variables `X` and `Y` are equal:
     нI5è›     #  Check whether `a` is larger than `f`
ë              # Else:
 XY›           #  Check whether `X` is larger than `Y`
               # (after which the top of the stack is output implicitly as result)

If anyone wants to try and golf it further, here is a helper program I've used to get the correct variables from the input-list.

Very impressed this has got under 100!  And thank you so much for adding the bounty.

@Anush I actually have the feeling 96 is pretty long, considering the non-golfing language Ruby got 151. ;p And np about the bounty. It's mainly for @SimplyBeautifulArt's approach, but at the same time to give the challenge some attention. The reason it got downvoted is because you posted it a few hours after your earlier answer with 3 powers. I personally like this challenge, and was the first to upvote and answer it, but I can still kinda see the truth in the very first comment under the challenge post at the same time. Hopefully the bounty will make your challenge 0 or positive, though :)

I dream of a getting 0! :)

[2,1,1,1,1,3,1,1,1,1] result 1 instead has to result 0

@RosLuP Fixed, along with other INFINITY cases due to $log_1(x)$. Unfortunately the byte-count is now longer below 100.

it seems I remember that log has always base >1... How to define log_1 ? In code I use oo only for the case in which the 2 values are both infinite... So case when one value is infinite and other finite would be ok... The suspect the range of this exercise 1..10 is too few too...

@RosLuP Tbh I dunno, not that familiar with logarithms tbh.. In Java it uses log_e(x)/log_e(1) to accomplish log_1(x); and in the Ruby it uses Math.log(x,1). In my 05AB1E answer .n is a logarithm builtin accepting two numbers as argument (input and base) and also does base_log(input). Maybe official logarithm always needs a base $\gt1$, but all three languages still accept it as valid input.

C, 168 180 bytes
C port from Kevin Cruijssen's answer.
#define l(a,b)log(a)/log(b)
z(a,b,c,d,e,f,g,h,i,j){float t=pow(i,j),y=l(l(g,b),c)-pow(d,e)+l(h,c)*t,z=l(l(a,f)*pow(b,c),g);return~-a&&f<2|(b<2|g<2?z>h:c<2|d<2?l(z,h)>t:y?y<0:a>f);}

Try it online

Hmmm... a port of a port *thonks*

Fails for 3,1,10,10,10,2,1,10,10,10 like my Java answer used to as well. And it's actually a port of @SimplyBeautifulArt's Ruby answer, since he's the one who came up with everything and fixed the bugs..

APL(NARS), chars 118, bytes 236
{p←{(a b c d)←⍵⋄a=1:¯1⋄b=1:⍟⍟a⋄(⍟⍟a)+(c*d)×⍟b}⋄(=/(a b)←{p 1↓⍵}¨⍺⍵)∧k←(∞ ∞)≡(m n)←{p(3↑⍵),*/3↓⍵}¨⍺⍵:(↑⍺)>↑⍵⋄k:a>b⋄m>n}

The function above call z, in "a z w" would return 1 if the number in a is greater than the number in w,
otherwise it would return 0.
If I have
f(a,b,c,d,e)=a^b^c^d^e

It will be f(aa)>f(bb) with both aa and bb array of 5 positive numbers if and only if
(if the a>1 of aa and bb) log(log(f(aa)))>log(log(f(bb))) one has to use the log() laws:
log(A*B)=log(A)+log(B)
log(A^B)=B*log(A)

for build v(aa)=log(log(aa))=v(a,b,c,d,e)=log(log(a))+log(b)(c^(d^e))={p(3↑⍵),/3↓⍵}
function and so the exercise is find when v(aa)>v(bb).
But there is a case where v(aa) and v(bb) are both infinite (APL has end the float space)
in that case i would use the unsecure function
s(a,b,c,d,e)=log(log(b))+log(c)*(d^e)={p 1↓⍵}

that i not fully understand if it is ok and it not take in count a parameter too...
test:
  z←{p←{(a b c d)←⍵⋄a=1:¯1⋄b=1:⍟⍟a⋄(⍟⍟a)+(c*d)×⍟b}⋄(=/(a b)←{p 1↓⍵}¨⍺⍵)∧k←(∞ ∞)≡(m n)←{p(3↑⍵),*/3↓⍵}¨⍺⍵:(↑⍺)>↑⍵⋄k:a>b⋄m>n}
  10 10 10 10 10 z 10 10 10 10 9
1
  1 2 3 4 5 z 5 4 3 2 1
0
  2 2 2 2 3 z 10 4 3 2 2
1
  10 6 4 2 2 z 10 6 2 4 2
0
  2 2 2 2 10 z 2 2 2 10 2
1
  10 9 8 7 6 z 6 7 8 9 10
0
  10 10 10 10 10 z 10 10 10 10 9
1
  2 2 2 2 3   z    10 4 3 2 2
1
  2 2 2 2 10   z   2 2 2 10 2
1
  10 10 10 10 10 z 9 10 10 10 10
1
  3 2 2 1 1   z    2 5 1 1 1
1
  2 2 3 10 1  z    2 7 3 9 1
1
  7 9 10 10 10 z   6 9 10 10 10
1
  3 2 2 2 2    z   2 2 2 2 2
1
  3 10 10 10 10 z  2 10 10 10 10
1
  8 3 1 2 1    z   2 2 3 1 1
1
  2 4 2 1 1    z   3 3 2 1 1
1
  5 4 3 2 1    z   1 2 3 4 5
1
  1 2 3 4 5    z   5 4 3 2 1
0
  6 7 8 9 10    z  6 7 8 9 10
0
  10 6 4 2 2 z     10 6 2 4 2
0
  10 9 8 7 6  z   6 7 8 9 10
0
  1 10 10 10 10 z 1 10 10 10 9
0
  2 4 1 1 1 z     2 2 2 1 1
0
  2 2 2 1 1    z  2 4 1 1 1
0
  2 5 1 1 1   z   3 2 2 1 1
0
  4 2 1 1 1   z   2 4 1 1 1
0
  2 4 1 1 1   z   4 2 1 1 1
0
  2 3 10 1 1  z   8 3 9 1 1
0
  8 3 9 1 1   z   2 3 10 1 1
0
  2 4 1 1 1   z   3 3 1 1 1
0
  2 2 1 9 9   z   2 2 1 10 10
0
  2 2 1 10 10 z   2 2 1 9 9
0
  1 1 1 1 1   z   1 2 1 1 1
0
  1 1 1 1 2   z   1 1 1 1 1
0
  1 1 1 1 1   z   1 1 1 1 1
0
  9 10 10 10 10 z  10 9 10 10 10
1
  9 10 10 10 10 z  10 10 10 10 10
0
  10 10 10 10 10 z  10 10 10 10 10
0
  11 10 10 10 10 z  10 10 10 10 10
1

The tests in the challenge description are lacking some edge cases. Could you verify that it's also working for all these test cases?

@KevinCruijssen the test 5 4 3 2 1 z 1 2 3 4 5 would result true n>1 your test would be wrong on that case

Ah oops, that one is indeed supposed to be true. Copy-paste error.. My bad. All the other test cases should be correct.

@KevinCruijssen      Here your test , if exclude the one above seems ok...

If all test cases are correct, then +1 from me. Looking forward seeing an explanation of your code. :)

Only logging twice leaves you vulnerable to fail test cases like 10, 10, 10, 10, 10, 9, 10, 10, 10, 10.

@SimplyBeautifulArt 10 10 10 10 10 z 9 10 10 10 10 return 1 so the left > right... What does it mean"logging  twice"?

You said you calculated each by taking log(log()), but for that test case, the difference between log(log(10^10^10^10^10)) and log(log(9^10^10^10^10)) would require an absurd amount of accuracy to pick up on. You'd need to have a floating point with about 2e10 base 10 digits of accuracy. And this is ignoring the fact that both sides are approximately as large as 10^10^10, which I find it hard to believe you were able to compute.

I'm not really sure how your code works, so I'm looking forward to that explanation. Perhaps it fails a test case like 10, 10, 2, 3, 10, 10, 10, 8, 3, 9, which should return 0.

@SimplyBeautifulArt in that case Apl return infinity both side, and so code would use the s() function...

@SimplyBeautifulArt the test 10 10 2 3 10 z 10 10 8 3 9 return 0

Perhaps it fails 9, 10, 10, 10, 10, 10, 9, 10, 10, 10, which should return 1, but s(9,10,10,10,10) < s(10,9,10,10,10).

Java 8, 299 288 286 252 210 208 224 bytes
Math M;(a,b,c,d,e,f,g,h,i,j)->{double t=M.pow(i,j),y=l(l(g,b),c)-M.pow(d,e)+l(h,c)*t,z=l(l(a,f)*M.pow(b,c),g);return a>1&&f<2|(b<2|g<2?z>h:c<2|d<2?l(z,h)>t:y==0?a>f:y<0);}double l(double...A){return M.log(A[0])/M.log(A[1]);}

Port of @SimplyBeautifulArt's Ruby answer, so make sure to upvote him!
-14 bytes thanks to @SimplyBeautifulArt.
+17 bytes for the same bug-fixes as the Ruby answer.
Try it online.
Explanation:
Math M;                      // Math M=null on class-level to save bytes

(a,b,c,d,e,f,g,h,i,j)->{     // Method with ten integer parameters and boolean return-type
  double t=M.pow(i,j),       //  Temp `t` = `i` to the power `j`
    y=l(l(g,b),c)            //  Temp `y` = `c`_log(`b`_log(`g`))
      -M.pow(d,e)            //  - `d` to the power `e`
      +l(h,c)*t,             //  + `c`_log(`h`) * `t`
    z=l(l(a,f)*M.pow(b,c),g);//  Temp `z` = `g`_log(`f`_log(`a`) * `b` to the power `c`)
  return a>1&&               //  If `a` is 1:
                             //   Return false
   f<2|(                     //  Else-if `f` is 1:
                             //   Return true
    b<2|g<2?                 //  Else-if either `b` or `g` is 1:
     z>h                     //   Return whether `z` is larger than `h`
    :c<2|d<2?                //  Else-if either `c` or `d` is 1:
     l(z,h)>t                //    Return whether `h`_log(`z`) is larger than `t`
    :y==0?                   //   Else-if `y` is 0:
      a>f                    //    Return whether `a` is larger than `f`
    :                        //   Else:
     y<0);}                  //    Return whether `y` is negative

// Separated method to calculate `B`_log(`A`) for inputs `A,B`
double l(double...A){return M.log(A[0])/M.log(A[1]);}

It seems to work fine if you use x==y instead of M.abs(x-y)<1e-9.

@SimplyBeautifulArt Wait, it does?.. Wtf. When I had my ungolfed version it didn't work for one test case. The string output was the same, but internally it ever so slightly differed.  The ungolfed version was your ungolfed version, before I changed it to the golfed ternary you have in your Ruby answer as well. Stupid floating point precision.. Will change it, since it works for the test cases in the current approach indeed. Thanks.

Lol, while you're at it you might want to look at my updates :^)

I can't help but wonder if you could avoid doing the Math M and go straight to defining a p for M.pow

@SimplyBeautifulArt In Java not unfortunately.. Have you seen my method l? ;p A method p would shortest be double p(double...A){return Math.pow(A[0],A[1]);}, so 3x M.pow is definitely shorter. (And I also use the Math M; for the two M.log.)

t is can be removed to save one byte by putting it into y like I did. TIO

@SimplyBeautifulArt Thanks. Will also update my 05AB1E answer with the same change. :)

Um... not sure about your math there on the byte count. It should be 209?

@SimplyBeautifulArt 208 actually. The semi-colon between the lambda and loose method isn't counted towards the total byte-count. This perhaps clarifies it a bit how it's usually counted.

Hm okay, if you say so :-)

@SimplyBeautifulArt Nvm about updating my 05AB1E answer with the same change. The byte-count would remain 96.

@RosLuP Fixed by porting the Ruby fix.


text:
Probabilistic approach puzzle
A few hours earlier, I got this puzzle:

Suppose, you toss a coin n times, then what is the probability of getting m number of heads? ( where m belongs to the set of all prime numbers)

For instance, take n = 2, then
SS = { HH, HT, TH, TT }
So, output is 1/4 (for HH case)
Then, for n = 3,
SS = { HHH, HHT, HTH, THH, HTT, THT, TTH, TTT }
So, output is (1 + 3)/8 (for 3 H's case and 2 H's cases respectively)
Input: n ( an integer, 0 <= n <= 1000 )
Output: The probability (in any distinguishable form, i.e., decimal, exponential, fraction, etc)
This is a code-golf, so fewest bytes would win!

When you say n<1000 you mean that we should get results or the code can run forever?

@J42161217, it depends on you. n < 1000 is just a range of input for n (0 <= n < 1000).

...the wording "where m is the set of all prime numbers" is a bit confusing, since you can't exactly have a number of heads equal to the set of all prime numbers (unless you're using an encoding of natural numbers into sets, in which case you should probably supply it!). I assume you actually mean that m is any prime number, although that wording suggests that you can pick a single one--it would be clearest to just not name it as a variable at all, and ask "in n flips of a fair coin, how likely are you to get a prime number of heads?"

Wolfram Language (Mathematica), 33 bytes
Uses Binomial and outputs ,really fast, fractions

Tr@Binomial[#,Prime@Range@#]/2^#&

Try it online!
The original code according to my formula was
Tr@Binomial[#,Prime@Range@PrimePi@#]/2^#&

but, as @attinat commented, instead of searching all Primes < n  we can
search the first n primes because every prime > n returns zero binomial.
In this way we save 8 bytes
Here is also the graph of the first 1000 cases which looks pretty cool

33 bytes: Binomial[n,k]==0 if n<k

@attinat very nice! I'll edit

Jelly, 7 bytes
cÆRSH⁸¡

Try it online!
How?
cÆRSH⁸¡ - Link@ integer, n                   e.g. 20
 ÆR     - primes to n                             [2,3,5,7,11,13,17,19]
c       - (n) choose (vectorises)                 [190,1140,15504,77520,167960,77520,1140,20]
   S    - sum                                     340994
      ¡ - repeat...
     ⁸  - ...times: chain's left argument, n
    H   - ...action: halve
        -   (170497, 85248.5, ..., ~0.65, ~0.325) 0.3251972198486328

oh how I wish there were an x/2^y atom that doesn't floor like æ» (actually this inspired me to make a pull request for one :))

05AB1E, 10 7 bytes
ÅPcOso/

Try it online!
Explanation
ÅP       # push a list of primes upto and including input
  c      # push choose(input, prime) for each prime
   O     # sum
    so   # push 2^input
      /  # divide

Octave/MATLAB  with Statistics Package/Toolbox, 32 bytes
@(n)sum(binopdf(primes(n),n,.5))

Try it online!

Python 3, 198 125 97 bytes
lambda n:f(n)/2**n
f=lambda n,h=0:h>1>sum(h%i<1for i in range(2,h))if n<1else f(n-1,h+1)+f(n-1,h)

Try it online!
To aid in understanding, I first generate all the of the possible combinations, then I get then total heads if that is prime, then I add the total number of primes.  The second function, h generates the result from function f.  Bellow is the original algorithm before minimizing it.
def f(n,h=""):
  count = 0
  if n==0:
    hCount=h.count("h")
    for i in range(2, hCount):
      if hCount % i == 0:
        return 0
    if hCount < 2:
      return 0
    return 1
  count += f(n-1,h+"h")
  count += f(n-1,h+"t")
  return count

def h(n):
  return f(n), (2**n)

print(h(4))

Credits:

From 125 to 97 bytes by attinat

97 bytes: sum(1for i in ... if c(i))==sum(c(i)for i in ...), apply De Morgan's Law and combine inequalities

Excel Formula, 311 309 bytes
The following should be entered as an array formula (Ctrl+Shift+Enter):
=SUM(IFERROR(COMBIN(A1,SMALL(IF(MMULT(--(IF(ROW(INDIRECT("2:"&A1))>TRANSPOSE(ROW(INDIRECT("2:"&A1))),MOD(ROW(INDIRECT("2:"&A1)),(ROW(INDIRECT("2:"&A1))>TRANSPOSE(ROW(INDIRECT("2:"&A1))))*TRANSPOSE(ROW(INDIRECT("2:"&A1)))))=0),ROW(INDIRECT("2:"&A1)))=0,ROW(INDIRECT("2:"&A1))),ROW(INDIRECT("1:"&A1)))),0))/(2^A1)

Where A1 is the number to test.
Examples:
A1=15
Result: 0.34997558593750
A1=25
Result: 0.341329127550125

Credits
-2 thanks to Sophia Lechner!

Good to see someone else using Excel! Save two bytes per use by replacing ROW(INDIRECT("1:"&A1)) with ROW(OFFSET(A1,,,A1))

@SophiaLechner Nice! Thank you!

Gaia, 12 8 bytes
:ṅK¦Σ@z÷

Try it online!
:		| dup input n
 ṅ		| push first n prime numbers, [2..k]
  K¦		| push n choose k (0 if k > n)
    Σ		| sum
     @z		| push 2^n
       ÷	| divide

Pari/GP, 35 bytes
n->binomial(n)*isprime([0..n])~/2^n

Try it online!

Retina, 41 bytes
K`
"$+"+%`^
$"H
*\Cm`^(?!(..+)\1+$)..
m`^

Try it online! Output is as a ratio. Explanation:
K`
"$+"+%`^
$"H

Generate all the possible coin tosses of n coins, but keep only the heads. (T$"H would keep the tails as well.)
*\Cm`^(?!(..+)\1+$)..

Count how many are prime and print on a separate line.
m`^

Count how many there are altogether.

JavaScript (ES7), 71 bytes
n=>(s=1,g=i=>i<n&&(s*=(n-i)/++i)*(p=d=>i%--d?p(d):d==1)(i)+g(i))``/2**n

Try it online!

Jelly, 7 bytes
Ø.ṗ§ẒÆm

Try it online!
Different approach from Jonathan Allan's answer.

Japt -x, 13 bytes
õÈj *UàX /2pU

Try it

source: Stack Exchange

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

sort: votes


text:
A Note on N!
J. E. Maxfield proved following theorem (see DOI: 10.2307/2688966):

If \$A\$ is any positive integer having \$m\$ digits, there exists a positive integer \$N\$ such that the first \$m\$ digits of \$N!\$ constitute the integer \$A\$.

Challenge
Your challenge is given some \$A \geqslant 1\$ find a corresponding \$N \geqslant 1\$.
Details

\$N!\$ represents the factorial \$N! = 1\cdot 2 \cdot 3\cdot \ldots \cdot N\$ of \$N\$.
The digits of \$A\$ in our case are understood to be in base \$10\$.
Your submission should work for arbitrary \$A\geqslant 1\$ given enough time and memory. Just using e.g. 32-bit types to represent integers is not sufficient.
You don't necessarily need to output the least possible \$N\$.

Examples
A            N
1            1
2            2
3            9
4            8
5            7
6            3
7            6
9           96
12           5
16          89
17          69
18          76
19          63
24           4
72           6
841      12745
206591378  314

The least possible \$N\$ for each \$A\$ can be found in https://oeis.org/A076219

I... why did he prove that theorem? Did he just wake up one day and say "I shall solve this!" or did it serve a purpose?

@MagicOctopusUrn Never dealt with a number theorist before, have you?

Here's the proof it anyone's interested.

Python 2, 50 bytes
f=lambda a,n=2,p=1:(`p`.find(a)and f(a,n+1,p*n))+1

Try it online!
This is a variation of the 47-byte solution explained below, adjusted to return 1 for input '1'. (Namely, we add 1 to the full expression rather than the recursive call, and start counting from n==2 to remove one layer of depth, balancing the result out for all non-'1' inputs.)
Python 2, 45 bytes (maps 1 to  True)
f=lambda a,n=2,p=1:`-a`in`-p`or-~f(a,n+1,p*n)

This is another variation, by @Jo King and @xnor, which takes input as a number and returns True for input 1. Some people think this is fair game, but I personally find it a little weird.
But it costs only 3 bytes to wrap the icky Boolean result in +(), giving us a shorter "nice" solution:
Python 2, 48 bytes
f=lambda a,n=2,p=1:+(`-a`in`-p`)or-~f(a,n+1,p*n)

This is my previous solution, which returns 0 for input '1'. It would have been valid if the question concerned a non-negative N.
Python 2, 47 bytes (invalid)
f=lambda a,n=1,p=1:`p`.find(a)and-~f(a,n+1,p*n)

Try it online!
Takes a string as input, like f('18').
The trick here is that x.find(y) == 0 precisely when x.startswith(y).
The and-expression will short circuit at `p`.find(a) with result 0 as soon as `p` starts with a; otherwise, it will evaluate to -~f(a,n+1,p*n), id est 1 + f(a,n+1,p*n).
The end result is 1 + (1 + (1 + (... + 0))), n layers deep, so n.

Nice solution by the way. I was working on the same method but calculating the factorial on each iteration; implementing your approach saved me a few bytes so +1 anyway.

For your True-for-1 version, you can shorten the base case condition taking a as a number.

@xnor I would have not thought of `-a`in`-p`, that's a neat trick :)

If the proof still holds if N is restricted to even values, then this 45 byte solution will always output a number.

Brachylog, 3 5 bytes
ℕ₁ḟa₀

Try it online!
Takes input through its output variable, and outputs through its input variable. (The other way around, it just finds arbitrary prefixes of the input's factorial, which isn't quite as interesting.) Times out on the second-to-last test case on TIO, but does fine on the last one. I've been running it on 841 on my laptop for several minutes at the time of writing this, and it hasn't actually spit out an answer yet, but I have faith in it.
         The (implicit) output variable
   a₀    is a prefix of
  ḟ      the factorial of
         the (implicit) input variable
ℕ₁       which is a positive integer.

Since the only input ḟa₀ doesn't work for is 1, and 1 is a positive prefix of 1! = 1, 1|ḟa₀ works just as well.
Also, as of this edit, 841 has been running for nearly three hours and it still hasn't produced an output. I guess computing the factorial of every integer from 1 to 12745 isn't exactly fast.

The implementation of the factorial predicate in Brachylog is a bit convoluted so that it can be used both ways with acceptable efficiency. One could implement a much faster algorithm to compute the factorial, but it would be extremely slow running the other way (i.e. finding the original number from the factorial).

Oh, cool! Looking at the source for it, I can't tell what all it's doing, but I can tell you put a lot of good thought into it.

C++ (gcc), 107 95 bytes, using -lgmp and -lgmpxx
Thanks to the people in the comments for pointing out some silly mishaps.
#import<gmpxx.h>
auto f(auto A){mpz_class n,x=1,z;for(;z!=A;)for(z=x*=++n;z>A;z/=10);return n;}

Try it online!
Computes \$n!\$ by multiplying \$(n-1)!\$ by \$n\$, then repeatedly divides it by \$10\$ until it is no longer greater than the passed integer. At this point, the loop terminates if the factorial equals the passed integer, or proceeds to the next \$n\$ otherwise.

You don't need to count flags anymore, so this is 107 bytes.

Why do you need the second semicolon before return?

You could use a single character name for the function, save a couple of bytes.

Jelly, 8 bytes
1!w⁼1ʋ1#

Try it online!
Takes an integer and returns a singleton.

05AB1E, 7 bytes
∞.Δ!IÅ?

Try it online or verify -almost- all test cases (841 times out, so is excluded).
Explanation:
∞.Δ      # Find the first positive integer which is truthy for:
   !     #  Get the factorial of the current integer
    IÅ?  #  And check if it starts with the input
         # (after which the result is output implicitly)

JavaScript, 47 43 bytes
Output as a BigInt.
n=>(g=x=>`${x}`.search(n)?g(x*++i):i)(i=1n)

Try It Online!
Saved a few bytes by taking Lynn's approach of "building" the factorial rather than calculating it on each iteration so please upvote her solution as well if you're upvoting this one.

Sadly, _Ês bU}f1 in Japt doesn't work

@EmbodimentofIgnorance, yeah, I had that too. You could remove the space after s.

@EmbodimentofIgnorance, you could also remove the 1 if 0 can be returned for n=1.

3 bytes less: x=i=1n;f=n=>\${x*=++i}`.search(n)?f(n):i`

@vrugtehagel, that wouldn't be reusable.

Does it have to be? As a full program, it outputs the correct number for a given input. I'm fairly new to code-golf, so enlighten me if this is some unwritten rule I didn't know about

@vrugtehagel, yes. It's one of our rules.

Pyth - 8 bytes
f!x`.!Tz

f              filter. With no second arg, it searches 1.. for first truthy
 !             logical not, here it checks for zero
  x    z       indexof. z is input as string
   `           string repr
    .!T        Factorial of lambda var

Try it online.

C# (.NET Core), 69 + 22 = 91 bytes
a=>{var n=a/a;for(var b=n;!(b+"").StartsWith(a+"");b*=++n);return n;}

Try it online!
Uses System.Numerics.BigInteger which requires a using statement.
-1 byte thanks to @ExpiredData!

69 + 22

Python 3, 63 bytes
f=lambda x,a=2,b=1:str(b).find(str(x))==0and a-1or f(x,a+1,b*a)

Try it online!
-24 bytes thanks to Jo King
-3 bytes thanks to Chas Brown

61 bytes

Jelly, 16 bytes
‘ɼ!³;D®ß⁼Lḣ@¥¥/?

Try it online!
Explanation
‘ɼ                | Increment the register (initially 0)
  !               | Factorial
   ³;             | Prepend the input
     D            | Convert to decimal digits
        ⁼   ¥¥/?  | If the input diguts are equal to...
         Lḣ@      | The same number of diguts from the head of the factorial
      ®           | Return the register
       ß          | Otherwise run the link again

Perl 6, 23 bytes
{+([\*](1..*).../^$_/)}

Try it online!
Explanation
{                     }  # Anonymous code block
   [\*](1..*)            # From the infinite list of factorials
             ...         # Take up to the first element
                /^$_/    # That starts with the input
 +(                  )   # And return the length of the sequence

Charcoal, 16 bytes
⊞υ¹Ｗ⌕ＩΠυθ⊞υＬυＩ⊟υ

Try it online! Link is to verbose version of code. Explanation:
⊞υ¹

Push 1 to the empty list so that it starts off with a defined product.
Ｗ⌕ＩΠυθ

Repeat while the input cannot be found at the beginning of the product of the list...
⊞υＬυ

... push the length of the list to itself.
Ｉ⊟υ

Print the last value pushed to the list.

Perl 5 -Mbigint -p, 25 bytes
1while($.*=++$\)!~/^$_/}{

Try it online!

J, 28 22 bytes
-6 bytes thanks to FrownyFrog
(]+1-0{(E.&":!))^:_&1x

Try it online!
original answer J, 28 bytes
>:@]^:(-.@{.@E.&":!)^:_ x:@1

Try it online!

>:@] ... x:@1 starting with an extended precision 1, keep incrementing it while...
-.@ its not the case that...
{.@ the first elm is a starting match of...
E.&": all the substring matches (after stringfying both arguments &":) of searching for the original input in...
! the factorial of the number we're incrementing

(]+1-0{(E.&":!))^:_&1x

I love that use of "fixed point" to avoid the traditional while.

C (gcc) -lgmp, 161 bytes
#include"gmp.h"
f(a,n,_,b)char*a,*b;mpz_t n,_;{for(mpz_init_set_si(n,1),mpz_init_set(_,n);b=mpz_get_str(0,10,_),strstr(b,a)-b;mpz_add_ui(n,n,1),mpz_mul(_,_,n));}

Try it online!

Suggest strstr(b=mpz_get_str(0,10,_),a)-b;mpz_mul(_,_,n))mpz_add_ui(n,n,1) instead of b=mpz_get_str(0,10,_),strstr(b,a)-b;mpz_add_ui(n,n,1),mpz_mul(_,_,n))

Jelly, 11 bytes
‘ɼµ®!Dw³’µ¿

Try it online!

Clean, 88 bytes
import StdEnv,Data.Integer,Text
$a=hd[n\\n<-[a/a..]|startsWith(""<+a)(""<+prod[one..n])]

Try it online!
Defines $ :: Integer -> Integer.
Uses Data.Integer's arbitrary size integers for IO.

Wolfram Language (Mathematica), 62 bytes
(b=1;While[⌊b!/10^((i=IntegerLength)[b!]-i@#)⌋!=#,b++];b)&

Try it online!

Ruby, 40 bytes
->n{a=b=1;a*=b+=1until"%d"%a=~/^#{n}/;b}

Try it online!

Icon, 65 63 bytes
procedure f(a);p:=1;every n:=seq()&1=find(a,p*:=n)&return n;end

Try it online!

Haskell, 89 bytes
import Data.List
a x=head$filter(isPrefixOf$show x)$((show.product.(\x->[1..x]))<$>[1..])

If anyone knows how to bypass the required import, let me know.

It seems that you output $N!$ and not $N$ as required.

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


text:
Interactive Maze Solver
Bob got kidnapped and is stuck in a maze. Your job is to help him find a way out. But since it is a very dark and scary maze, he can't see anything. He can only feel walls when he runs in to it, and knows when he has found the exit, but doesn't know anything more that.
Since he has to run your program by memory, it has to be as short as possible.
Note: I took this problem from http://acmgnyr.org/year2016/problems.shtml, but adapted it slightly, and wrote the judge program/test cases myself.
Specification

This is an interactive problem, so you program will output moves to stdout, and take in responses from stdin.
Your program can output one of the moves right, left, down, up.
It will then get as input one of the following:

wall - this means that Bob has hit a wall. Bob will stay in the same place.
solved - Bob has found the exit! Your program should now also exit without printing anything else.
ok - Bob was able to move in the given direction.

If the maze has no exit, your program should output no exit to let Bob know that he should give up. Your program should then exit without printing anything else.
Since Bob is in a hurry to get out, your program should not make any extraneous moves. In other words, your program is not allowed to move in the same direction from the same square twice.
This is code-golf, so shortest program wins!

Examples
In the following examples, S is the starting square, X is the exit, # is a wall, and spaces are valid squares. Since there is no single correct answer, these are just example runs of a solution. Also note that the drawings of the maze are just there for you to see, and your program will not get them as input.
########
#S     #
###### #
     # #
     #X#

right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              wall
down
              ok
right
              wall
down
              ok
right
              wall
down
              solved

#####
# S #
#####

right
              ok
right
              wall
down
              wall
up
              wall
left
              ok
down
              wall
up
              wall
left
              ok
down
              wall
up
              wall
left
              wall
right
              ok
no exit
              solved

###############################
#S                            #
##############       ###      #
             #       #X#      #
             #                #
             ##################

right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              ok
right
              wall
down
              ok
right
              wall
down
              ok
right
              wall
down
              ok
right
              wall
down
              wall
left
              ok
down
              wall
up
              ok
up
              ok
left
              ok
down
              ok
down
              ok
down
              wall
left
              ok
down
              wall
up
              ok
up
              ok
left
              ok
down
              ok
down
              ok
down
              wall
left
              ok
down
              wall
up
              ok
up
              ok
left
              wall
down
              ok
left
              wall
down
              ok
left
              ok
down
              wall
up
              wall
left
              ok
down
              wall
up
              solved

Checker Program

I have written a solution checker in Python. You can find it at https://gist.github.com/Maltysen/f0186019b3aa3812d812f8bb984fee19.
Run it like python mazechecker.py ./mazesolver.
It will test your program on all the mazes in a folder called mazes.
The mazes are in separate files in the same format from above.
It checks all the conditions listed above, and notifies you if your solution violates any.
You can have it print additional diagnostic info with python mazechecker.py -d ./mazesolver.
You can find a zipped mazes folder here. You can also add your own to it if you want.

I was writing a comment about how it would be nice if this could use a black-box function instead of I/O for navigating the maze, but then I realized that not only would that black-box function need to be implemented for every maze for every language that tries to use it, but it would need to be implemented statefully... so interactivity being the only option is probably best.

It’s probably worth explicitly stating that the problem was released under a CC-BY-NA-SA license, and so your remix is necessarily under the same licence.

Do we get a solved when outputting no exit? If so please state so in the rules, not only in the test cases!

Oops.. deleted my wrong comment, so here again: is there a maximum size for the maze, of can it be infinitely long. Or to be more concrete: can I create a matrix variable with pre-defined dimensions if my language isn't able to dynamically change the dimensions along the way?

"your program is not allowed to move in the same direction from the same square twice." Two questions regarding this: 1. Let's say I'm at position x,y and go up, with respond wall, then right with again respond wall, may I then try up again, or are only left and down still available since I haven't moved from this square yet?

Let's say I have this maze. With this flow: right (ok); right (ok); right (wall); up (ok); up (ok); up (wall); left (wall); down (ok); down (ok); down (ok); down (ok); down (wall); right (wall); up (ok); up (ok); Am I now again allowed to go up even though I already did from that specific square before (at the bold one)?

@KevinCruijssen I think the sequence up (ok); up (wall); left (wall); down (ok); is invalid. If you go back where you came from before all other directions were tested, you cannot enforce the penultimate rule (your program is not allowed to move in the same direction from the same square twice).

@Arnauld Hmm, in that case my answer is invalid as I feared it might be after I posted the comments above, since I travel in a random direction which isn't the same as the previous.. :( If what you say is correct, and both my comments above are invalid, it means you always have to check all directions in the priority order: not visited yet; visited already but not a wall; reverse move since no more paths are available. So we'll have to keep track of where we came from, where the walls are, and which cells we've already visited if I understand correctly? Am I forgetting something?

@KevinCruijssen I don't explicitly keep track of where I came from in my answer. Instead, I keep track of all directions that were processed on each square and I try unvisited squares first. When all unvisited squares have been tried, the only remaining legal move is where I came from (already visited, but not in this direction).

@Arnauld Ah, yeah, that's a better approach. :) I'm gonna wait for OP to confirm what we've concluded before I change anyway, so will leave things as they are for now. Apart from what I sketched in my two comments above, my current program works as intended and will be able to reach either the state from input solved or output no exit. It's not the most efficient however. ;p As mentioned in my answer, I suck at matrix/path-finding challenges.. Even though they're usually great challenges.

@KevinCruijssen yeah, Arnauld's interpretation is correct. You have to dfs fully into all the other directions before backtracking out. Also, the maze is finite but could be arbitrarily large.

@Maltysen Was afraid you might say that. Will delete my answer and fix if I have some time. Although it will probably require a new approach from scratch to fix the arbitrarily large size, using ArrayLists instead of fixed-size arrays and adding a leading/trailing columns to each row in a loop.. So not sure if it will be undeleted anytime soon, if at all. Ah well. Regardless, nice challenge. Even if my answer is invalid, I had fun (and slight frustration for some parts) when making it. ;)

Can the maximum maze size be my language's integer datatype's maximum?

@EmbodimentofIgnorance yeah, sure.

JavaScript (ES6),  180  174 bytes
Uses prompt() to output the direction and retrieve the result.
_=>(g=p=>[...'012301234'].some((d,i)=>g[p]>>d&1|i<4&g[P=[p[0]+(d-2)%2,p[1]+~-d%2]]>0?0:(r=prompt('up/left/down/right/no exit'.split`/`[g[p]|=1<<d,d]))<'s'?g(P):r<'t'))([0,0])

Try it online! (with automated I/O)
Interactive snippet
WARNING: this code will display a prompt() dialog until 'solved' is entered or the function figures out that there's no exit at all.

(
_=>(g=p=>[...'012301234'].some((d,i)=>g[p]>>d&1|i<4&g[P=[p[0]+(d-2)%2,p[1]+~-d%2]]>0?0:(r=prompt('up/left/down/right/no exit'.split`/`[g[p]|=1<<d,d]))<'s'?g(P):r<'t'))([0,0])
)()

Commented
_ => (                      // anonymous function taking no argument
  g = p =>                  // g = recursive function taking the current position p = [x, y]
    [ ...'0123',            // i<4  : try to move on squares that haven't been visited yet
      ...'0123',            // 3<i<8: try to go back to where we initially came from
      ...'4'                // i=8  : if everything failed, there must be no exit
    ].some((d, i) =>        // for each direction d at index i:
      g[p] >> d & 1         //   if this direction was already tried at this position
      | i < 4 &             //   or i is less than 4 and
      g[P = [               //   the square at the new position P = [X, Y] with:
        p[0] + (d - 2) % 2, //     X = x + dx[d]
        p[1] + ~-d % 2      //     Y = y + dy[d]
      ]] > 0 ?              //   was already visited:
        0                   //     abort
      : (                   //   else:
        r = prompt(         //     output the direction:
          [ 'up',           //       0 = up
            'left',         //       1 = left
            'down',         //       2 = down
            'right',        //       3 = right
            'no exit'       //       4 = no exit
          ][                //
            g[p] |= 1 << d, //       mark this direction as used
            d               //       d = actual index of the string to output
          ]                 //     r = result of prompt()
        )                   //
      ) < 's' ?             //     if r = 'ok':
        g(P)                //       do a recursive call at the new position
      :                     //     else:
        r < 't'             //       yield true if r = 'solved' or false if r = 'wall'
    )                       // end of some()
)([0, 0])                   // initial call to g at (0, 0)

Python3, 408 bytes:
E=enumerate;P=print
def f(m):
 q,d=[(x,y)for x,r in E(m)for y,s in E(r)if'S'==s],{}
 while q:
  x,y=q.pop(0)
  for M,X,Y in[('up',-1,0),('down',1,0),('left',0,-1),('right',0,1)]:
   if 0<=(j:=x+X)<len(m)and 0<=(k:=y+Y)<len(m[0])and(j,k)not in(V:=d.get((x,y),[])):
    C=m[j][k]
    if'X'==C:P(M+' solved');return
    elif'#'==C:P(M+' wall')
    else:print(M+' ok');q+=[(j,k)];d[(x,y)]=V+[(j,k)]
 P('no exit')

Try it online!


text:
Fix Brain-Flak push-pop redundancy
Brain-Flak is a stack-based esoteric language with eight commands:
()     Evaluates to 1
<>     Switch active stack; evaluates to 0
[]     Evaluates to height of current stack
{}     Pop current stack; evaluates to the popped number
(...)  Execute block and push the result; evaluates as result
<...>  Execute block; evaluates as 0
[...]  Execute block; evaluates as negation of result
{...}  While top of active stack is nonzero, execute block

Write a program or function to detect and remove one common type of push-pop redundancy that often occurs when writing Brain-Flak code.
Finding Redundancy
To determine whether a push and pop are truly redundant, we must understand which scopes use the return value of instructions:

The return value of any top-level instruction is ignored.
(...) will always use the return values of its children.
<...> will always ignore the top-level instruction of its children.
{...} will pass the return values of its children to the enclosing scope; that is, their return values will be used if and only if {...} itself is in a scope that uses its return value.
[...] theoretically works like {...} in this sense; however, you may assume that [...] is always in a scope that cares about return value, thus treating it like (...).

The type of redundancy we are interested in occurs in any substring of the form (A)B{} satisfying the following:

A is a balanced string; that is, the parentheses around A are matched.
(A) is in a scope that ignores its return value.
B does not contain [], <>, or either half of the {...} monad.
The {} immediately following B pops the value pushed by (A).  That is, B has an equal number of {} and ...), and no prefix of B has more {} than ...).

Note that B is typically not a balanced string.
Removing Redundancy
To remove this redundancy, we temporarily introduce a symbol 0 to the language, which evaluates to 0.  With this symbol, a redundant string (A)B{} can be safely replaced by 0BA.  Since Brain-Flak does not have a 0 symbol, we must make simplifications to remove it:

A 0 with a sibling can be removed entirely, as can any top-level 0s.  (If there are two 0s as the only children of a monad, only one of them can be removed.)
[0] and <0> can be simplified to 0.
If you encounter a (0), find the matching {}; replace the (0) and matching {} with 0s.
{0} will never happen.  If I'm wrong about this, you may have undefined behavior in this case.

Rules

Input is a string taken by any reasonable method.
Input is guaranteed to be valid Brain-Flak code consisting only of brackets.
Any [...] monads in the input will be in scopes that do not ignore their return values.
Output is a semantically equivalent Brain-Flak program with no push-pop redundancies as defined above.
The output program must not be longer than the result of the algorithm described above.
The input might not contain any redundancy; in that case, the input program should be output unchanged.
If your solution is in Brain-Flak, it should hopefully not detect any redundancy in its own code.
This is code-golf, so the shortest program (in bytes) in each language wins.

Test cases
With redundancy (with redundant push and pop marked):
Shortest redundancy
({}){} -> {}
^  ^^^

First example from tips post
({}<>)({}()) -> ({}<>())
^    ^ ^^

Second example from tips post
({}<({}<>)><>)(<((()()()){}[((){}{})])>) -> (<((()()()){}[((){}<({}<>)><>{})])>)
^            ^                 ^^

Inside the zero monad
({}<({}{})>{}) -> ({}{}{})
    ^    ^ ^^

Inside a loop
{({}{})([{}])} -> {([{}{}])}
 ^    ^  ^^

Stack height pushed
([][]())({}()) -> ([][]()())
^      ^ ^^

Loop result pushed
({({}[()])}{})(({})) -> (({({}[()])}{}))
^            ^  ^^

Two redundancies
({}<({}{})>)({}{}) -> ({}{}{})
^   ^    ^ ^ ^^^^

Discovered redundancy
(({})){}({}()) -> ({}())
^^  ^^^^ ^^

Chained redundancy
(<(()()())>)(({}){}{}({})) -> (()()()({}))
  ^      ^         ^^

No redundancy (output should be the same as input):
-empty string-
(({}<>)({}()))         - unlike the second test case, the pushed value is used again
(({}){})               - standard code for doubling the top value on the stack
({}{})<>{}             - push and pop not on same stack
(()){{}{}}             - loop starts between push and pop
({(({}[()]))}{})([]{}) - stack height is used after push

Surely (0) can never happen since in order to be removed (A) must be in a zeroed scope.

@WheatWizard (<(A)>) becomes (<0>), which in turn becomes (0).

Shouldn't ({}<({}{})>{}) become ({}{}{}), not ({}({}{}))? ({}<({}{})>{}) -> ({}<0>{}{}) -> ({}0{}{}) -> ({}{}{})

In fact, it seems that the "two redundancies" example simplifies to the "inside the zero monad" example before going to the listed ({}{}{})

@tjjfvi I'm not sure how that got by me.  Fixed.

Is it alright if some pprs that aren't described by the challenge are also performed, e.g. ((<>){}) can be reduced to (<>), but it won't be reduced by the method described in the challenge.  My code doesn't currently but I believe I could save some bytes this way.

@WheatWizard I'll allow it.  The main reason for the strict output was so (A) wouldn't simply be replaced by a redundant () or <()>.

Haskell, 995 973 873 bytes
Nitrodon saved me 22 bytes with a way around the monomorphism restriction
Not well golfed, but golfed a bit.
I implement my own parsing library here.  Not a wise idea for golf.  If I really wanted to make this short I would probably just use an off the shelf one like parsec.
I also lose a ton of bytes to the type and instance declarations.  This could definitely be done without them and it would probably save bytes.
import Control.Monad
newtype P b a=P{h::b->[(b,a)]}
instance Functor(P b)where fmap f(P p)=P$map(f?)?p
instance Applicative(P b)where pure x=P(\y->[(y,x)]);(<*>)=ap
instance Monad(P b)where P p>>=f=P$(>>=uncurry(flip$h.f)).p
f?x=f<$>x
l=s"("
k=s"()"
o=s")"
w=words
p x=pure x
e=P$p[]
x%y=liftM2(++)x y
P p#P q=P$p%q
b q=P(\x->[(b,a)|a:b<-[x],q a])
t=p?b(p$1>0)
s=mapM$b.(==)
a=foldr(#)e
n p=P(\x->[(x,())|[]==h p x])
v=a[s[x]%c%s[y]%c|[x,y]<-w"() <> {} []"]#s"0"
c=v#s""
d 0=a[n(a$s?w"<> [] { } )")*>a[k,n k*>t]%d 0,o%d 1,p""]
d x=a[n(s"<>"#s"[]")*>k#(p?b(`elem`"(<>[]"))%d x,s"{}"%d(x-1),o%d(x+1)]
f z=a[a[p""|z],(s"{"#s"[")%f z,l%f(0>1),s"<"%f(1>0),v%f z]
m=p""#(t%m)<*q
q=P(\x->[([],"")|[]==x])
z=a[s"0"*>p"",(s"["#s"<")*>z<*(s"]"#s">"),l%z%o*>p"<(0)>"]
r=a[n z*>t%r,z%r,q]
u x=head$(u.snd<$>((>>=h r.snd).h(do x<-f$1>0;l;i<-v;o;y<-d 0;s"{}";((x++'0':y++i)++)?m))x)++[x]

Try it online!
Haskell, Ungolfed
Here's what this looks like ungolfed.
balanced :: Parser String
balanced =
  ( choice
    [ string [x]
      <> balanced
      <> string [y]
      <> balanced
    | [x, y] <- ["()", "<>", "{}", "[]"]
    ]
  ) <|> string ""
    <|> string "0"

getBetween :: Int -> Parser String
getBetween pushes
  | pushes > 0 =
  choice
    [ do
      notAhead $ string "<>"
      notAhead $ string "[]"
      start <- string "()" <|> fmap pure (charBy (`notElem` "{})"))
      rest <- getBetween pushes
      pure $ start ++ rest
    , do
      string "{}"
      rest <- getBetween (pushes - 1)
      return $ "{}" ++ rest
    , do
      string ")"
      rest <- getBetween (pushes + 1)
      return $ ')' : rest
    ]
  | pushes == 0 =
  choice
    [ do
      notAhead $ string "<>"
      notAhead $ string "[]"
      notAhead $ char '{'
      notAhead $ char '{'
      notAhead $ char ')'
      start <- choice
        [ string "()"
        , do
          notAhead $ string "()"
          chr <-charBy $ const True
          return [chr]
        ]
      rest <- getBetween pushes
      pure $ start ++ rest
    , do
      string ")"
      rest <- getBetween (pushes + 1)
      return $ ')' : rest
    , pure ""
    ]

getBefore :: Bool -> Parser String
getBefore zeroed
  | zeroed
  =
    choice
      [ pure ""
      , do
        next <- choice $ map char "<{["
        rest <- getBefore zeroed
        return $ next : rest
      , do
        char '('
        rest <- getBefore False
        return $ '(' : rest
      , do
        prefix <- balanced
        guard $ prefix /= ""
        rest <- getBefore zeroed
        return $ prefix ++ rest
      ]
  | otherwise
  =
    choice
      [ do
        next <- choice $ map char "({["
        rest <- getBefore zeroed
        return $ next : rest
      , do
        char '<'
        rest <- getBefore True
        return $ '<' : rest
      , do
        prefix <- balanced
        guard $ prefix /= ""
        rest <- getBefore zeroed
        return $ prefix ++ rest
      ]

mainParser :: Parser String
mainParser =
  do
    before <- getBefore True
    char '('
    inside <- balanced
    guard $ inside /= ""
    char ')'
    between <- getBetween 0
    string "{}"
    after <- many $ charBy $ const True
    end
    return $ before ++ "0" ++ between ++ inside ++ after

zero :: Parser String
zero =
  choice
    [ char '0' *> pure ""
    , choice
      [ char x *> zero <* char y
      | [x, y] <- ["[]", "<>"]
      ]
    , do
      char '('
      zero
      char ')'
      return $ "<(0)>"
    ]

removeZeros :: Parser String
removeZeros =
  choice
    [ do
      notAhead zero
      chr <- charBy $ const True
      rest <- removeZeros
      return $ chr : rest
    , zero <> removeZeros
    , end *> pure ""
    ]

run :: String -> String
run input =
  case
    map snd $ apply (compose mainParser removeZeros) input
  of
    [] ->
      input
    x ->
      head $ map run x

Try it online!

p x=pure x seems to be a shorter way to deal with the monomorphism restriction.

@Nitrodon Thanks.  That saves me a bunch.

This fails the "chained redundancy" test case (scroll down in the code block), outputting ({}()()()({})) instead of (()()()({}))

@tjjfvi That was an easy fix.  It actually had very little to do with chaining.  It was just I wasn't deleting zeros properly.

JavaScript, 449 600 580 bytes
-13 bytes thanks emanresu A
(@WheatWizard wrote their answer first, causing me to look at this challenge; this answer is not intended to steal their glory)
x=>{for([...x].reduce((_,b)=>"({[<".includes(b)?(y.unshift([b,--i+"#"]),y[1].push(y[0])):(b==")"&&y[0][2]&&j.push(y[0][1]),x=y.shift()).push(b!="}"|x[3]?b:b+(j.pop()||"-0#")),y=[[]],i=0,j=[]),y=y[0].reduce(g=(a,b)=>b[3]?a+b[0]+b[1]+b.slice(2,-1).reduce(g,"")+b[1]+b.pop():a+b[0]+b[2],"");x!=y;)y=(x=y).replace(/(((<-\d+#|^)([<[({]((-\d+#).+\5)?[\])}>]|X)*)(({-\d+#|^)([<[({]((-\d+#).+\11)?[\])}>]|X)*)*)\((-\d+#)(.*)\12\)(((?!\[\]|<>|\{-|#}).)*){}\12|\((-\d+#)(X)\16\)(((?!\[\]|<>|\{-|#}).)*){}\16|\[-\d+#X-\d+#\]|<-\d+#X-\d+#>/,"$1X$18$17$14$13");return y.replace(/-\d+#|X/g,"")}

Try it online!
A horrific solution that uses string manipulation.
First, it recursively parses the program and adds annotations:
original:
(<(()()())>)(({}){}{}({}))
annotated:
(-1#<-2#(-3#()()()-3#)-2#>-1#)(-7#(-8#{}-1#-8#){}-8#{}-3#(-12#{}-0#-12#)-7#)

The -N%s inside brackets denote matching brackets. Additionally, {}s are annotated with the -N# of the () they pop.
Then, regex substitutions are repeatedly applied until it stabilizes (X is used instead of 0):
(this is an explanation of the old regex; the new one that accounts for more cases is beyond explanation)
/\((-\d+#)(.*)\1\)(((?!\[\]|<>|\{-|#}).)*){}\1/X$3$2
 \(                                                   literal open paren
   (-\d+#)                                            group 1, matches a -N#
          (.*)                                        group 2, this is A
              \1\)                                    matching close paren
                  (((?!\[\]|<>|\{-|#}).)*)            group 3, this is B
                    (?!\[\]|<>|\{-|#})                there can be no [], <>, {-, or #}
                                          {}\1        the {} that pops (A)
                                               X$3$2  replace with X, followed by groups 2 and 3
/\[-\d+#X-\d+#\]/X  replace [-N#X-N#] with X
/<-\d+#X-\d+#>/X  replace <-N#X-N#> with X

In the actual implementation, these are all combined into a single unioned regex.
The (0) case from the original algorithm is just a special case of the (A)B{} -> 0BA transformation, so no special casing is needed for it.
Once it stabilizes, all Xs (these must be have a sibling) and -N#s are removed, and the resulting string is returned.

This fails the (({}<>)({}())) and (({}){}) test cases, both of which should remain unchanged.

@nitrodon Hmm, I thought I tested those. Does B have to be non-empty? Otherwise I think the latter would become ({}). I’m also not sure why the former would be unchanged; wouldn’t it become (({}<>()))?

The reason they need to remain unchanged is that the push (A) is in a valued scope.  Both the push and the pop generate value so when you combine them you only get that value once.  For example: (({}){}) doubles the input, while your reduced form: ({}) (pretty much) does nothing.

Ah, I guess I missed "(A) is in a scope that ignores its return value"

@Nitrodon Updated, and tested on all cases

587 with some minor golfs - test fully please.

@emanresuA Thanks, that works. The b.length == 2 check could have actually been b.length < 3, so I've updated it with that as well.


text:
Congruent Numbers
Definitions:

A triangle is considered a right triangle if one of the inner angles is exactly 90 degrees.
A number is considered rational if it can be represented by a ratio of integers, i.e., p/q, where both p and q are integers.
A number n is a congruent number if there exists a right triangle of area n where all three sides are rational.
This is OEIS A003273.

Challenge
This is a decision-problem challenge. Given an input number, x, output a distinct and consistent value if x is a congruent number, and a separate distinct and consistent value if x is not a congruent number. The output values do not necessarily need to be truthy/falsey in your language.
Special Rule
For the purposes of this challenge, you can assume that the Birch and Swinnerton-Dyer conjecture is true. Alternatively, if you can prove the Birch and Swinnerton-Dyer conjecture, go claim your $1,000,000 Millennium prize. ;-)
Examples
(Using True for congruent numbers and False otherwise).
5 True
6 True
108 False

Rules and Clarifications

Input and output can be given by any convenient method.
You can print the result to STDOUT or return it as a function result. Please state in your submission what values the output can take.
Either a full program or a function are acceptable.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Is the input a positive integer?

My initial approach was to multiply the input by an arbitrary square number until it's half of the product of the legs in a Pythagorean triple, but then I realized it might be a bit hard to actually terminate for a non-congruent input.

@Xi'an Okay, but challenges should be self-contained.

@Lynn Yes, the input will be a positive integer.

R, 179 173 142 141 137 135 134 bytes
Using the same arguments based on Tunnell's Theorem, returns a 0 if nis not congruent and 1 otherwise. (It took me a long while to spot the constraint on the condition only applying to squared-free integers.)
function(n){b=(-n:n)^2
for(i in b^!!b)n=n/i^(!n%%i)
P=1+n%%2
o=outer
!sum(!o(y<-o(8/P*b,2*b,"+")/P-n,z<-16/P*b,"+"),-2*!o(y,4*z,"+"))}

Try it online
Improvements brought by Arnaud and Giuseppe (the final code is mostly Guiseppe's!), with -3 thanks to Robin
Syntax analysis:
for(i in b[b>0])n=n/i^(!n%%i) #eliminates all square divisors of n
P=2^(n%%2)                    #n odd (2) or even (1)
o=outer                       #saves 3 bytes
o(8/P*b,2*b,"+")/P-n          #all sums of (8/P)x^2+(2/P)*y^2-n
o(...,16/P*b,"+")             #all sums of above and (16/P)*z^2
o(...,4*z,"+"))               #all sums of above and (64/P)*z^2
!o(...,4*z,"+"))              #all sums of above equal to zero
!sum(!...,2*!...)             #are zeroes twice one another (Tunnell)

with Tunnell's Theorem stating that n is congruent if and only if the number of integer solutions to 2x²+y²+8z²=n is twice as much as the number of integer solutions to 2x²+y²+32z²=n if n is odd and  the number of integer solutions to 8x²+y²+16z²=n is twice as much as the number of integer solutions to 8x²+y²+64z²=n if n is even.

Welcome to PPCG! The goal is to make code as short as possible. Perhaps you might look at these tips for golfing or these R-specific tips.

There's a lot of whitespace, and also I'd recommend including a link to Try It Online! to help verify your code :-)

Feel free to reach out in the R golfer chat too if you'd like; you can notify by using @[username]...I'm guessing you got pulled into code golf by Robin Ryder??

142 bytes -- anonymous functions are perfectly fine, and I made a few other golfs that I'm happy to explain

Nice! Is there a reason you use -n:n? I didn't read Tunnel's theorem, but it seems to me that n:0 would work just as well for -1 byte...Also, pro tip, if you hit the "link" button on the top of TIO, you'll get nice formats for copying and pasting into PPCG :-) EDIT: I see, there are some cases where n:0 doesn't work.

137 bytes using outer instead of for loops.

@Giuseppe: It took me most of the day to figure out why -n:n was needed instead of `0:n..! Is there a way with TIO to avoid changing the link every time?

Welcome! And sorry for pulling you in... ;-)
You can gain 2 bytes by replacing 2^(n%%2) with 1+n%%2.

You can shave off another byte by replacing b[b>0] with b^!!b (which transforms the 0 in 0^0=1 and leaves all the other entries unchanged).

C++ (gcc), 251 234 bytes
Thanks to @arnauld for pointing out a silly typo on my part.
-17 bytes thanks to @ceilingcat.
#import<cmath>
int a(int n){int s=sqrt(n),c,x=-s,y,z,i=1,X;for(;++i<n;)for(;n%(i*i)<1;n/=i*i);for(;x++<s;)for(y=-s;y++<s;)for(z=-s;z++<s;c+=n&1?2*(n==X+24*z*z)-(n==X):2*(n==4*x*x+2*X+48*z*z)-(n/2==2*x*x+X))X=2*x*x+y*y+8*z*z;return!c;}

Try it online!
Returns 1 if n is congruent, 0 otherwise.
Given that we can assume that the Birch and Swinnerton-Dyer conjecture is true, I used Tunnel's Theorem as a test. Note that technically only nonzero x, y, and z need to be tested, as a set of positive (x, y, z) implies more sets for when each of those is negative, since the four numbers defined use the square of x, y, and z in their calculation. Additionally, since only the ratio of the two numbers A and B, or C and D, is desired, we need not even worry about these other sets. Thus, we only need to add 2 for every solution for A or C, and subtract 1 for every solution of B or D, and check if we end with 0. Also, the input is reduced to a squarefree integer, because if \$q\$ is a congruent number then \$s^2q\$ is also congruent (the algorithm seems to break on some square-containing numbers.

@Arnauld: ah, that was a typo on my part. fixed.

Rust - 282 bytes
fn is(mut n:i64)->bool{let(mut v,p)=(vec![0;4],n as usize%2);while let Some(l)=(2..n).filter(|i|n%(i*i)==0).nth(0){n/=l*l;}for x in -n..=n{for y in -n..=n{for z in -n..=n{for i in 0..2{if n-6*x*x*(n+1)%2==2*x*x+(2-n%2)*(y*y+(24*i as i64+8)*z*z){v[2*p+i]+=1};}}}}v[2*p]==2*v[2*p+1]}

Use Jerrold B. Tunnell's theorem, which I dont actually understand, but seems to work anyways.
divide n by all its square factors, to make it 'square free', since in the papers below Tunnell's theorem is described for square-frees only.

I believe this might work because every congruent number, when multiplied by a square, creates a bigger congruent number, and vice versa. so by testing the smaller number, we can validate the larger, which in our case is n. (all the removed squares, can be multiplied together to make one big square).

loop through all possible combinations of x,y,z integers, test Tunnell's equations:
$$\text{if n is odd, test if n = }2x^2 + y^2 + 32z^2\text{ and/or }
2x^2 + y^2 + 8z^2$$
$$\text{if n is even, test if n = }8x^2 + 2y^2 + 64z^2
\text { and/or } 8x^2 + 2y^2 + 16z^2$$

in the code itself, the four equations have been smooshed into one, inside a loop, using modulo for even/odd

keep a tally count of which equations match n
after looping, test the ratios of the tallies (per Tunnell)

See Also:

If you wish, try the code on the Rust Playground
Congruent Numbers, Elliptic Curves, and Modular Forms, by Guy Henniart, Bilkent University website, translated by Franz Lemmermeyer
The Congruent Number Problem, by Keith Conrad, University of Connecticut website
Congruent numbers, by Brian Hayes, bit-palyer.org blog

corrected even/odd, thanks@Level River St

oh well, at the time i got this working i only saw the c++ answer which was wrong...

thanks Level River St

APL (Dyalog Unicode), 73 67 bytes
{e←2∨w←⍵÷×⍨⊃⌽⍒⍵|⍨×⍨⍳⍵⋄0=¯2⊥+/w=e×⍪(r∘.+⍨32 8∘.×r)∘.+2×e×r←0,2/×⍨⍳w}

Try it online!
-6 bytes thanks to @ngn and @H.PWiz.
Essentially the same algorithm as others.
Ungolfed and how it works
f←{
  ⍝ Extract squarefree part of ⍵
  w←⍵÷×⍨⊃⌽⍒⍵|⍨×⍨⍳⍵
⍝             ×⍨⍳⍵  ⍝ Square of 1..⍵
⍝          ⍵|⍨      ⍝ Remainders of dividing ⍵ by each of the above
⍝       ⊃⌽⍒         ⍝ Last item of descending sort order; index of last 0
⍝ w←⍵÷×⍨            ⍝ Remove square term and name it w

  ⍝ 1 if odd, 2 if even; divide w by that
  w÷←e←2∨w
⍝    e←2∨w  ⍝ GCD of w with 2; name it e
⍝ w÷←       ⍝ Divide w by e and overwrite to w

  ⍝ Square of plus-minus range
  r←0,2/×⍨⍳w
⍝       ×⍨⍳w  ⍝ Square of 1..w
⍝ r←0,2/      ⍝ Make two copies of each number, prepend 0 and name it r

  ⍝ y2+32z2 (A/C) and y2+8z2 (B/D), with y and z swapped
  m←∘.(32 8⊥¨∘⊂,)⍨r
⍝   ∘.(         )⍨r  ⍝ Self outer product of r by...
⍝              ,     ⍝ Concatenate two input numbers and
       32 8⊥¨∘⊂      ⍝ Interpret as base-32 and base-8
⍝ m←                 ⍝ Name it m

  ⍝ Add 2×e×x2
  m←,m∘.+2×e×r
⍝    m∘.+2×e×r  ⍝ Outer product by + with 2×e×x2
⍝ m←,           ⍝ Flatten and overwrite m

  ⍝ count w in m and check if B/D is twice A/C
  0=¯2⊥⊃+/w=m
⍝         w=m  ⍝ Test for each sum being w
⍝      ⊃+/     ⍝ Count of 'w's in A/C and B/D
⍝   ¯2⊥        ⍝ (¯2×A/C) + B/D
⍝ 0=           ⍝ Equals 0?
}

2-2| -> 2|-

@H.PWiz No, that would give e=0 for even w instead of 2, and it doesn't match the required formula.

Oops, what about 2∨?

@H.PWiz Yeah, that should work.

{0=¯2⊥+/⍪w=e×⊃∘.+/(32 8)1(2×e←2∨w)∘.×¨⊂0,2/×⍨⍳w←⍵÷×⍨⊃⌽⍒⍵|⍨×⍨⍳⍵}

JavaScript (ES7), 165 bytes
Much like @NeilA.'s answer, this is based on Tunnell's theorem and therefore assumes that the Birch and Swinnerton-Dyer conjecture is true.
Returns a Boolean value.
n=>(r=(g=i=>i<n?g(i+!(n%i**2?0:n/=i*i)):n**.5|0)(s=2),g=(C,k=r)=>k+r&&g(C,k-1,C(k*k)))(x=>g(y=>g(z=>s+=2*(n==(X=(n&1?2:8)*x+(o=2-n%2)*y)+o*32*z)-(n==X+o*8*z))))|s==2

Try it online!
How?
We first transform the input \$n\$ into its square-free counterpart \$n'\$, compute \$r=\lfloor\sqrt{n'}\rfloor\$ and initialize \$s\$ to \$2\$.
r = (                // we will eventually save isqrt(n) into r
  g = i =>           // g = recursive function taking an integer i
    i < n ?          //   if i is less than n:
      g(i + !(       //     do a recursive call with either i or i + 1
        n % i**2 ?   //     if n is not divisible by i²:
          0          //       yield 0 and therefore increment i
        :            //     else:
          n /= i * i //       divide n by i² and leave i unchanged
      ))             //     end of recursive call
    :                //   else:
      n ** .5 | 0    //     stop recursion and return isqrt(n)
  )(s = 2)           // initial call to g with i = s = 2

We then define the helper function \$g\$ which invokes a callback function \$C\$ with \$k^2\$ for \$-r<k\le r\$.
  g = (C, k = r) =>  // C = callback function, k = counter initialized to r
    k + r &&         //   if k is not equal to -r:
    g(               //     do a recursive call:
      C,             //       pass the callback function unchanged
      k - 1,         //       decrement k
      C(k * k)       //       invoke the callback function with k²
    )                //     end of recursive call

We finally use 3 nested calls to \$g\$ to walk through all triplets \$(x,y,z) \in [-r+1,r]^3\$ and update \$s\$ to test whether \$2A_n = B_n\$ if \$n\$ is odd or \$2C_n=D_n\$ if \$n\$ is even, with:
$$\begin{align}
&A_n=\#\{(x,y,z)\in [-r+1,r]^3 \mid n=2x^2+y^2+32z^2\}\\
&B_n=\#\{(x,y,z)\in [-r+1,r]^3 \mid n=2x^2+y^2+8z^2\}\\
&C_n=\#\{(x,y,z)\in [-r+1,r]^3 \mid n=8x^2+2y^2+64z^2\}\\
&D_n=\#\{(x,y,z)\in [-r+1,r]^3 \mid n=8x^2+2y^2+16z^2\}
\end{align}$$
g(x =>                            // for each x:      \    NB:
  g(y =>                          //   for each y:     >-- all these values are
    g(z =>                        //     for each z:  /    already squared by g
      s +=                        //       add to s:
        2 * (                     //         +2 if:
          n == (                  //           n is equal to either
            X =                   //           An if n is odd (o = 1)
            (n & 1 ? 2 : 8) * x + //           or Cn if n is even (o = 2)
            (o = 2 - n % 2) * y   //
          ) + o * 32 * z          //
        ) - (                     //         -1 if:
          n == X + o * 8 * z      //           n is equal to either
        )                         //           Bn if n is odd
    )                             //           or Dn if n is even
  )                               //
)                                 // if s in unchanged, then n is (assumed to be) congruent

Ruby, 126 bytes
->n{[8,32].product(*[(-n..-t=1).map{|i|i*=i;n%i<1&&n/=i;i}*2+[0]]*3).map{|j|d=2-n%2
k,x,y,z=j
2*d*x+y+k*z==n/d&&t+=k-16}
t==1}

Try it online!
found a place to initialize t=1 and expanded the list of squares into a triplet instead of using q to make additional copies.
Ruby, 129 bytes
->n{t=0
[8,32].product(q=(-n..-1).map{|i|i*=i;n%i<1&&n/=i;i}*2+[0],q,q).map{|j|d=2-n%2
k,x,y,z=j
2*d*x+y+k*z==n/d&&t+=k-16}
t==0}

Try it online!
Uses Tunnell's theorem like the other answers. I use a single equation as follows.
2*d*x^2 + y^2 + k*z^2 == n/d  where d=2 for even n and d=1 for odd n

We check the cases k=8 and k=32 and check if there are twice as many solutions for k=8 than k=32. This is done by adding k-16 to t every time we find a solution. This is either +16 in the case k=32 or -8 in the case k=8. Overall the number is congruent if t is the same as its initial value at the end of the function.
It is necessary to find all solutions to the test equation. I see many answers testing between +/-sqrt n. It is perfectly OK to test also outside these limits if it makes code shorter, but no solutions will be found because the left side of the equation will exceed n. The thing I missed in the beginning is that negative and positive x,y,z are considered separately. Thus -3,0,3 yields three squares 9,0,9 and all solutions must be counted separately (0 must be counted once and 9 must be counted twice.)
Ungolfed code
->n{t=0                              #counter for solutions

  q=(-n..-1).map{|i|i*=i;n%i<1&&n/=i #make n square free by dividing by -n^2 to -1^2 as necessary
  i}*2+[0]                           #return an array of squares, duplicate for 1^2 to n^2, and add the case 0

  [8,32].product(q,q,q).map{|j|      #make a cartesian product of all possible values for k,x,y,z and iterate
    d=2-n%2                          #d=1 for odd n, 2 for even n
    k,x,y,z=j                        #unpack j. k=8,32. x,y,z are the squared values from q.
    2*d*x+y+k*z==n/d&&t+=k-16}       #test if the current values of k,x,y,z are a valid solution. If so, adjust t by k-16 as explained above.
t==0}                                #return true if t is the same as its initial value. otherwise false.

about positive and negative solutions, same here, I wasted quite a while missing this point!

authors: Xi'an ні війні


text:
Word Changer Reachability
Word changer is a game where you are trying to turn one word into another via single-character edits, with each step being its own word. For this challenge, edits may be replacements, insertions, or deletions. For example, WINNER → LOSER can be done with this route (there may be others):
WINNER
DINNER
DINER
DINE
LINE
LONE
LOSE
LOSER

Phrased another way, you must be able to reach one word from the other going only through other words at a Levenshtein distance of 1 each time.
Coding
You will be given a word list and two words and you must output a valid route from one word to the other if a route exists or a distinct constant value or consistent behavior if no route exists.

You may assume that the input words are both in the word list
The word list can be taken in via any convenient flat format.

Lists, sets, tries, space-separated strings, and line-separated files are all valid (for instance), but a pre-computed graph of Levenshtein adjacency is not.

The output route should include both input words, but which starts and ends doesn't matter.
If no route is found, you can output a specific constant, a falsy value, empty list, throw an exception, exit with a nonzero code, or any other behavior that happens in finite time.
The route does not need to be optimal and there is no requirement of which route should be taken
Computational complexity does not matter, however your program must be provably guaranteed to terminate in a finite amount of time. (even if it would run beyond the heat death of the universe)
You may assume all words are entirely composed of letters in the same case

Example Test Cases

CAT → DOG; [CAT, DOG, COG, COT, FROG, GROG, BOG]

CAT, COT, COG, DOG

BATH → SHOWER; [BATH, SHOWER, HATH, HAT, BAT, SAT, SAW, SOW, SHOW, HOW]

No Route Found

BREAK → FIX; [BREAK, FIX, BEAK, BREAD, READ, BEAD, RED, BED, BAD, BID, FAD, FAX]

BREAK, BREAD, BEAD, BAD, FAD, FAX, FIX

BUILD → DESTROY; [BUILD, DESTROY, BUILT, GUILT, GUILD, GILD, GILL, BILL, DILL, FILL, DESTRUCT, STRUCTURE, CONSTRUCT]

No Route Found

CARD → BOARD; [CARD, BOARD, BARD]

CARD, BARD, BOARD

DEMON → ANGEL; [DEMON, ANGEL]

No Route Found

LAST → PAST; [LAST, PAST, BLAST, CAST, BLACK, GHOST, POST, BOAST]

LAST, PAST

INSERT → DELETE; This word list

INSERT, INVERT, INVENT, INBENT, UNBENT, UNBEND, UNBIND, UNKIND, UNKING, INKING, IRKING, DIRKING, DARKING, DARLING, ARLING, AILING, SIRING, SERING, SERINE, NERINE, NERITE, CERITE, CERATE, DERATE, DELATE, DELETE

Related, Related

Can we output a list of valid routes or should it be one route?

@Emigna any route will do. As I mentioned "The route does not need to be optimal"

Do we need to include the starting and ending word in the output? The routes will always start and end the same!

@MagicOctopusUrn "The output route should include both input words, but which starts and ends doesn't matter."

@Beefster ah, sorry for asking an already answered question. It came from the comments of an answer ;).

05AB1E, 23 21 20 bytes
Prints a list of valid routes.
Saved 2 bytes thanks to Kevin Cruijssen.
æ€œ€`ʒü.LP}ʒ¬²Qsθ³Q*

Try it online!

You can save 2 bytes by changing Dævyœ«} to æ€œ€` . (Not sure why both maps separately with € works fine, but æεœ`} does not btw, but it's the same byte-count anyway.)

Too bad the product of [] is 1 instead of 0 (not too surprising, though) or that an equal check with an empty list apparently results in an empty list instead of 0 (this one I see as a bug..).. Otherwise you could have combined the filter and find_first to save another byte: æ€œ€`.Δü.LPy¬²Qsθ³QP

@KevinCruijssen: Thanks! Not sure why I didn't think of using €. I think the equal check results in an empty list due to vectorization. Maybe there should be a special case for the empty list, but maybe that would be unexpected in other cases.

Yeah, I indeed realized it's due to vectorization after I made my comment. I mentioned it in the 05AB1E chat. But maybe this special case for empty lists would be beneficial for almost all vectorization usages instead of just Q. Not sure, though.

Does something like this work for 17: Try it online!

@MagicOctopusUrn: Unfortunately, we need to include all words of the path in the output.

@Emigna yeah I couldn't reconcat the cat (or the dog for that matter) for less than 22 ;).

JavaScript (V8),  177  176 bytes
Takes input as (target)(source, list). Prints all possible routes. Or prints nothing if there's no solution.
t=>F=(s,l,p=[],d)=>s==t?print(p):l.map((S,i)=>(g=(m,n)=>m*n?1+Math.min(g(m-1,n),g(m,--n),g(--m,n)-(S[m]==s[n])):m+n)(S.length,s.length)^d||F(S,L=[...l],[...p,L.splice(i,1)],1))

Try it online!
Commented
t =>                            // t = target string
F = (                           // F is a recursive function taking:
  s,                            //   s = source string
  l,                            //   l[] = list of words
  p = [],                       //   p[] = path
  d                             //   d = expected Levenshtein distance between s and the
) =>                            //       next word (initially undefined, so coerced to 0)
  s == t ?                      // if s is equal to t:
    print(p)                    //   stop recursion and print the path
  :                             // else:
    l.map((S, i) =>             //   for each word S at index i in l[]:
      ( g =                     //     g = recursive function computing the Levenshtein
        (m, n) =>               //         distance between S and s
        m * n ?                 //       if both m and n are not equal to 0:
          1 + Math.min(         //         add 1 to the result + the minimum of:
            g(m - 1, n),        //           g(m - 1, n)
            g(m, --n),          //           g(m, n - 1)
            g(--m, n) -         //           g(m - 1, n - 1), minus 1 if ...
            (S[m] == s[n])      //           ... S[m - 1] is equal to s[n - 1]
          )                     //         end of Math.min()
        :                       //       else:
          m + n                 //         return either m or n
      )(S.length, s.length)     //     initial call to g with m = S.length, n = s.length
      ^ d ||                    //     unless the distance is not equal to d,
      F(                        //     do a recursive call to F with:
        S,                      //       the new source string S
        L = [...l],             //       a copy L[] of l[]
        [...p, L.splice(i, 1)], //       the updated path (removes S from L[])
        1                       //       an expected distance of 1
      )                         //     end of recursive call
    )                           //   end of map()

Wolfram Language (Mathematica), 59 bytes
Select[Rule@@@#~Tuples~2,EditDistance@@#<2&]~FindPath~##2&;

Try it online!

Python 2, 155 bytes
f=lambda a,b,W,r=[]:a==b and r+[a]or reduce(lambda q,w:q or any({a,a[:i]+a[i+1:]}&{w,w[:i]+w[i+1:]}for i in range(len(a+w)))and f(w,b,W-{a},r+[a]),W-{a},0)

Try it online!
Takes two words and a set of words as input; returns a (non-optimal) route if one exists as a list of strings, otherwise returns False.
This fragment:
any({a,a[:i]+a[i+1:]}&{w,w[:i]+w[i+1:]}for i in range(len(a+w)))

is True if and only if a==w or a has Levenshtein distance of 1 from w.

Wolfram Language (Mathematica), 124 bytes
Join[#,Select[Flatten[Permutations/@Subsets@#3,1],s=#;t=#2;Union[EditDistance@@@Partition[Join[s,#,t],2,1]]=={1}&][[1]],#2]&

Try it online!

Python 2, 163 bytes
If a route is found, it is output to stderr and the program exits with exit code 1.
If there is no route, there is no output and the program terminates with exit code 0.
s,e,d=input();r=[[s]]
for x in r:t=x[-1];t==e>exit(x);r+=[x+[w]for w in d-set(x)for a,b in(t,w),(w,t)for i in range(len(b)*2)if a==b[:i/2]+a[i/2:][:i%2]+b[i/2+1:]]

Try it online!

Python 3, 217 214 212 201 bytes
-11 bytes thanx to a hint from xnor
d=lambda a,b:min(d(a[1:],b[1:])+(a[0]!=b[0]),d(a[1:],b)+1,d(a,b[1:])+1)if b>""<a else len(a+b)
def g(a,b,l,p=[]):
	if a==b:yield[a]+p
	for c in(a!=b)*l:
		if(c in p)+d(a,c)==1:yield from g(c,b,l,[a]+p)

Try it online!

Jelly, 38 bytes
⁵ḟ,€0ị$ṭ¹-Ƥ$€e€/ẸƊƇḢ€
Wṭ@ⱮÇßƊe@⁴oṆƲ?€Ẏ

Try it online!
A full program accepting three arguments. The first is the starting word and is supplied as [["START"]]. The second argument is the final word, supplied as "END". The third argument is the word list, supplied as quoted, comma-separated words.
The program returns a list of lists, with each list representing a valid path from the start to the end. If there is no valid route, the response is an empty list.
In the TIO link, there is footer text to display the result nicely with each word separated by spaces and each list of words separated by newlines. If a printout underlying list representation is preferred, this could be done as ÇŒṘ.
Unlike 05ABIE, there’s no built-in for Levenshtein distance, so this program compares outfixes with a single character missing, somewhat similar to @ChasBrown’s solution, although with a Jelly twist.
Explanation
Helper link: monadic link that takes a list of words and returns a list of possible extended lists, or an empty list if no further extension is possible
⁵ḟ                      | Filter the word list to remove words already used
  ,€0ị$                 | Pair each word with the last word in the current path
                  ƊƇ    | Filter these pairs such that
              e€/Ẹ      |   there exists any
       ṭ¹-Ƥ$€           |   match between the original words or any outfix with a single character removed
                    Ḣ€  | Take the first word of each of these pairs (i.e. the possible extensions of the route)

Main link
              €         | For each of the current paths
            Ʋ?          | If:
       e@⁴              |   The path contains the end word
          oṆ            |   Or the path is empty (i.e. could not be extended)
W                       | Return the path wrapped in a list (which will be stripped by the final Ẏ)
 ṭ@ⱮÇ                   | Otherwise, look for possible extensions using the helper link, and add onto the end of the path
     ßƊ                 | And then feed all of these paths back through this link
               Ẏ        | Strip back one layer of lists (needed because each recursion nests the path one list deeper)

Swift 4.2/Xcode 10.2.1, 387 bytes
func d(l:String,m:String)->Bool{return (0..<l.count).contains{var c=l;c.remove(at:c.index(c.startIndex,offsetBy:$0));return c==m}};func f(r:[String])->[String]{if b==r.last!{return r};return w.lazy.map{!r.contains($0)&&(d(l:r.last!,m:$0)||d(l:$0,m:r.last!)||(r.last!.count==$0.count&&zip(r.last!,$0).filter{$0 != $1}.count==1)) ? f(r:r+[$0]):[]}.first{!$0.isEmpty} ?? []};return f(r:[a])

Try it online!