Skip to main content

New answers tagged

1 vote

Find the most isolated point

vemf, 13 bytes, O(n²) Boring quadratic solution as a function that takes two lists of vectors. Could maybe be shorter with complex numbers? ...
taswelll's user avatar
  • 151
2 votes

Find the most isolated point

K (ngn/k), \$O(N^2)\$, 22 bytes A function that takes \$P\$ and \$T\$ as its first, and second argument, respectively. ...
akamayu's user avatar
  • 561
0 votes

Find the most isolated point

Google Sheets, \$O(n^2+)\$, 109 bytes let(d,map(x,y,lambda(x,y,min(map(z,t,lambda(z,t,sumsq(z-x,t-y)))))),index({x,y},+sort(sequence(rows(d)),d,))) This is a named ...
doubleunary's user avatar
  • 1,705
2 votes

Find the most isolated point

Charcoal, 25 bytes, O(n²) ≔Eθ⌊EηΣEλX⁻ν§ιξ²η⭆¹§θ⌕η⌈η Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 172k
1 vote

Find the most isolated point

Python, \$\mathcal{O}(n^2)\$, 72 bytes lambda P,T:max(P,key=lambda p:min((p[0]-X)**2+(p[1]-Y)**2 for X,Y in T)) Using math.dist ...
corvus_192's user avatar
  • 5,532
1 vote

Distance between two points in n-dimensional space

Go, 97 bytes import."math" func f(p,q[]float64)(d float64){for i:=range p{d+=Pow(p[i]-q[i],2)} return Sqrt(d)} Attempt This Online!
bigyihsuan's user avatar
  • 9,776
1 vote

Find the most isolated point

JavaScript (ES7), \$\mathcal{O}(n^2)\$, 90 bytes Expects (P)(T). ...
Arnauld's user avatar
  • 193k
1 vote

Find the most isolated point

APL+WIN, 26 bytes Prompts for T then P as nested vectors of points: P[↑⍒(+/¨((P←⎕)∘.-⎕)*2)*.5] Try it online! Thanks to Dyalog Classic
Graham's user avatar
  • 6,286
2 votes

Draw the South Korean flag

Chipmunk Basic, 612 603 bytes Latest beta of Chipmunk Basic (v368b2.02) on MacOS. The code is saved to a file korea.bas, then loaded and run from the application ...
roblogic's user avatar
  • 2,944
3 votes

A cube of text឵

Vyxal, 13 bytes L?∞Ṫ»∨¹0²H»ø∧ Try it Online! Indirectly -1 byte thanks to Kevin Cruijssen, I forgot how canvas operator overloading works. ...
emanresu A's user avatar
  • 38.8k
1 vote

A cube of text឵

Ruby, 114 bytes ->s{t="#{" "*w=2*v=s.size} "*u=w-1 v.times{|i|9.times{|j|t[[u*v,~v,u][j/3]-[1,~w,w][j%3]*~(j%-4/3*2)*i]=s[~i]}} t} Try it ...
Level River St's user avatar
0 votes

Draw the national flag of Iceland

Uiua, 51 bytes ≡▽9▽9÷99⟨0_28_87|+99⊚3|⊂84⊟.16⟩↻9_¯9↧2⊞↧∩↧∩⟜⇌⇡18⇡25 Try it online! In 0..18 and 0..25, take the minimum of each with the reversed range, then take ...
noodle person's user avatar
2 votes

A cube of text឵

05AB1E, 35 12 bytes gIû¨•5ÏlÐθ•Λ -23 bytes by porting emanresuA's Vyxal answer, so make sure to upvote that answer as well! Try it online. Original 35 bytes answer:...
Kevin Cruijssen's user avatar

Top 50 recent answers are included