Hot answers tagged

17 votes

Detect round trips on a hyperbolic grid

Python, 266 bytes ...
9 votes

Detect round trips on a hyperbolic grid

Vyxal, 26 bytes fC‹\1꘍›ṅ»¬½ẆZ¶ẋḞ≥P»3R2€yøV Try it Online! Port of @Neil's Retina answer. Returns a falsey value if the path is closed and truthy otherwise. ...
  • 2,096
9 votes

Detect round trips on a hyperbolic grid

Retina 0.8.2, 55 bytes \d $*RF FRRRFRRRF RFRFR FRFRF RRRFRRRFRRR }`FF|RRRR ^$ Try it online! Takes input as 123 but test suite ...
  • 156k
7 votes

We're gonna need a bigger podium!

MATL, 26 24 bytes xt:Z^!"@tufm?@&=sqz1G=vs Inputs T, then R. The code takes a ...
  • 102k
6 votes

Record Least Uncommon Multiple Counts

Python + SymPy, \$119/47\approx 2.532\$ on my computer ...
  • 40.4k
5 votes

Classify a surface from its fundamental polygon

Curry (PAKCS), 159 bytes ...
  • 40.4k
5 votes

We're gonna need a bigger podium!

JavaScript (ES6), 88 bytes Expects (t)(r). ...
  • 179k
5 votes

Record Least Uncommon Multiple Counts

J, \$178/48 \approx 3.708 \$ Based on alephalpha's comment, powered by J's fast prime factorisation. ...
  • 56.2k
4 votes

Output the sign

Trilangle, 21 bytes ?\<'1(0@'^\.!_@>'0.(# Try it in the online interpreter! Unfolds to this: ...
  • 2,058
4 votes

Raise integer x to power x, without exponentiation built-ins

Nibbles, 3 2.5 bytes (6 5 nibbles) `*^$_ Attempt This Online! Returns the correct answer of \$1\$ for an input of \$0\$, as it is generally accepted that \$0^0=1\$ ...
  • 10.9k
4 votes

Canonical form of a cubic Bézier curve

JavaScript (ES6), 55 bytes -2 thanks to @Neil Returns \$false\$, \$true\$, \$2\$ or \$3\$ for double, loop, arch and single respectively. ...
  • 179k
4 votes

Detect round trips on a hyperbolic grid

Charcoal, 52 bytes ≔⭆SXχ⊕⌕LSRιθW⌊ΦE⪪”←“tU≧*h?λêQ✳x”¶⪪κ №θ⌈κ≔⪫⪪θ⌈ι⌊ιθ¬θ Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. ...
  • 156k
4 votes

We're gonna need a bigger podium!

PARI/GP, 46 bytes f(r,t)=Vec(r!/(2-exp(x+O(x^t++))+x)^r-=t-2)[t] Attempt This Online!
  • 40.4k
4 votes

We're gonna need a bigger podium!

R, 105 bytes (or 91 bytes in in R≥4.1 by exchanging function for \) ...
4 votes

We're gonna need a bigger podium!

05AB1E, 21 15 bytes LZãʒÐêāQi¢≠OQ]g -6 bytes by porting @LuisMendo's MATL answer, so make sure to upvote him as well! Inputs in the order \$R,T\$. Try it online or ...
4 votes

Record Least Uncommon Multiple Counts

Mathematica 13.2 112/48 113/48 \$\approx 2.35\$ PyCharm 2020 + Python 3.8 was used for run Python code. Thanks to @alephalpha for the cool math idea, please vote for his answer! ...
  • 1,153
3 votes

Transpose a 3x3 matrix across the anti-diagonal

BQN, 3 bytes ⌽˘⌽ Try it online! Explanation ...
3 votes

Pseudofactorial

Regex 🐇 (PCRE2 v10.35+), 60 59 54 bytes ^((?*(?=(xx+?)\2*$|)((?=x\2)(?=(x+)(\4+$))\5)*+x+)x)*$ Takes its input in unary, as a ...
  • 10.9k
3 votes

Pseudofactorial

Nibbles, 5.5 bytes /|,~~+.,@%@ Attempt This Online! ...
  • 6,543
3 votes

Detect round trips on a hyperbolic grid

05AB1E, 27 26 (or 23) bytes Ç<°JΔ•6o₁EAÛr£ð•3B2¡ι`:}õQ Port of AndrovT's top Vyxal answer, which in turn is a port of @Neil's Retina answer, which in turn is ...
2 votes

Pseudofactorial

Brachylog, 5 bytes fa~⟦₁ Try it online! Reversed I/O. ...
2 votes

Pseudofactorial

Desmos, 16 bytes f(n)=[1...n].lcm Super straightforward Try It On Desmos!
  • 11.3k
2 votes

Fibonacci reversed!

Japt, 8 bytes ô!gM è<U Try it Original, 9 bytes Can handle larger inputs than the version above. nMgV°)©Òß Try it
  • 39.6k
2 votes

Pseudofactorial

Nim, 52 bytes import math,sequtils func p[I](n:I):I=lcm toSeq 1..n Attempt This Online!
  • 6,543
2 votes

Hilbert Primes Golf

Raku, 35 bytes grep {$_%%none 5,9...^$_},(5,9...*) Try it online! This is an expression for the lazy, infinite list of Hilbert primes. ...
  • 7,246
2 votes

Find the maximum deviation

PowerShell, 70 bytes (0..(-$d+$v.count)|%{$s=$v[$_..($_+$d-1)]|sort;$s[-1]-$s[0]}|sort)[-1] Try it online!
2 votes

Divisibility test

Pyt, 1 byte | Try it online! Trivial built-in. Takes d then n
2 votes

Raise integer x to power x, without exponentiation built-ins

awk - a LOT of bytes (123 ?, per Deadcode), but it includes the full recursive binary squaring algorithm tailored for ...
2 votes

Raise integer x to power x, without exponentiation built-ins

Thunno D, \$5\log_{256}(96)\approx\$ 4.12 bytes ZOA*P Attempt This Online! Note: the built-in solution would have been just one ...
  • 9,446
2 votes

Raise integer x to power x, without exponentiation built-ins

Fortran (GFortran), 73 bytes integer(selected_int_kind(32))::n read*,n;print*,product([(n,j=1,n)]);end Try it online!. Uses a larger integer type because the ...
  • 2,118

Only top scored, non community-wiki answers of a minimum length are eligible