PieCot
• Member for 6 years
• Last seen this week

MATLAB, 14 bytes repmat('*',10)

LISP, 128 122 bytes Hi! This is my code: (defmacro D(x y)`(list(*(cadr,x)(caddr,y))(*(caddr,x)(car,y))(*(car,x)(cadr,y))))(defun c(a b)(mapcar #'- (D a b)(D b a))) I know that it isn't the shortest ...

Matlab, 87,5% function hat=is_blackhat_here2(filepath) img_hsv = rgb2hsv(imread(filepath)); img_v = img_hsv(:,:,3); bw = imdilate(imerode( ~im2bw(img_v), strel('disk', 4, 8)), strel('disk', 4, 8)); ...

Python3, 59 bytes lambda l:{len({*d}):''.join(d)for d in zip(*l)}.get(len(l)) Returns a string with the enklact, None otherwise

Score 136 Only for the records: #include <cstdio> #define def class a{public #define greet() #define print(a) };int main(){puts(a);} Another (less efficient) way to handle the colon.

MATLAB, 102 bytes Hi, this is my matlab solution: p=@(x)(imwrite(floor(randi(2,5,2)*[eye(2) ones(2,1)./2 fliplr(eye(2))]),[0.9412*[1 1 1];rand(1,3)],x)) The input x of the function is the name of ...

MATLAB, 100 bytes function X=o(m,s) X=find(bintprog(-1*s(:,3),[s(:,2)';s(:,1)';-1*s(:,1)'],[m(2);m(1)+5;5-m(1)])==1); The Binary Optimization problem is solved through the bintprog function, ...

Python3, 346 bytes Based on a recursive implementation of the Chudnovsky algorithm, one of the fastest algorithms to estimate pi. For each iteration, roughly 14 digits are estimated (take a look here ...

Python 3, 156 150 bytes I've considered y as a consonant. lambda a,b:{a[:i]+b[j:]for i in range(1,len(a))for j in range(1,len(b))if((a[i-1]in'aeiou')^(b[j]in'aeiou'))*0**(a in a[:i]+b[j:]or b in a[:...

Python O(mn log mn) The best pairs can be found computing the distances of all the possible pairs, and iteratively choosing the best pair among those remaining after filtering out the already chosen ...

Rust, 49 48 bytes $\times\,\frac{32186368}{744521728}\approx2.075$ Plain Rust, compiled with -C target-cpu=native -C opt-level=3. Clearly not the winner, only for reference; not bad, btw :) fn ...

Octave, 32 25 bytes @(x)char(kron(x+0,[1,1])) Try it online! -7 bytes thanks to Giuseppe

Matlab >= r2015a, 16 bytes @(x)repelem(x,2) Credits to Giuseppe Note: I haven't found an online interpreter for MATLAB; this answer correctly works with MATLAB r2015a. Matlab <= r2014b, 23 ...

MATLAB/Octave, 31 29 27 bytes @(n)9-find(dec2bin(n,8)-48) reduced of 2 bytes thanks to alephalpha reduced of 2 bytes thanks to Giuseppe Try it online!

Python 3, 55 bytes p=lambda l,i=-1:not l or f'{l[0]**int(p(l[1:],0))}'[i:] Older versions p=lambda l,i=-1:len(l)and f'{l[0]**int(p(l[1:],0))}'[i:]or 1 (60 bytes)

Python 3, 338 bytes This implementation is based on the Chudnovsky algorithm, one of the fastest algorithms to estimate pi. For each iteration, roughly 14 digits are estimated (take a look here for ...

Python3, 90 bytes (76 70 bytes 3-most-significant-digits version) h=lambda v,u=0:v>999.4and h(v/1024,u+2)or"%.*f%sB"%(u and(v<10)+(v<100),v,"KiMiGi"[u-2:u]) Version whose outputs are ...

MATLAB, 58 44 bytes Thanks to @Stewie Griffin for saving a bunch of bytes ;) [repmat(kron(['/\';'\/'],ones(4,5)),3,6),''] Old version: p=@()char(47+45*kron(ones(3,6),kron([0 1;1 0],ones(4,5))))

MATLAB, 86 bytes a=@(n)(char(changem(randi(92,n),33+[0:55 57:87 89:93],1:92).*(eye(n)|fliplr(eye(n))))) Some examples: >> a(1) ans = i >> a(3) ans = ~ { Z * ^ >>a(5) ans =...

MATLAB, 231 bytes Here a matlab solution: function g=z(r,q,s,p);[x,y]=meshgrid(1:2*r,1:2*r);d=(x-r).^2+(y-r).^2;h=size(d);e=zeros(h);e(d<r^2 & d>=q^2)=1;f=bwperim(e,4);k=rand(h);j=numel(s);...

Octave / Matlab, 25 23 bytes @(x)repmat(' ',size(x)) Saved 2 bytes thanks to Giuseppe Try it online!

Matlab, 226 bytes DISCLAIMER: Not an "original" implementation, only for fun. Simple solution taking advantage of the intlinprog function: function r=f(a);b=-1*a(1:end-1,end);p=a(end,1:end-1);c=a(1:...

Python3, 51 bytes lambda a,b:[v for v in a if{n:1 for n in b}.get(v)] If the input lists can contain duplicates: Python3, 67 bytes lambda a,b:list({v:1 for v in a if {n:1 for n in b}.get(v)}.keys()...

MATLAB, 61 bytes Not the shortest solution, but still interesting f=@(a)~any(changem(upper(a),90:-1:65,65:90)-fliplr(upper(a)))

LISP, 117 bytes The algorithm ends in n + 1 iterations, where n is the length of the shortest list in input. (defun o(a b)(let((c(car a))(d(car b)))(if(null a)b(if(null b)a(if(< c d)(cons c(o(cdr ...

MATLAB, 69 68 bytes function h=d(a) [r,c]=size(a);h=repmat(a,c,1).*kron(eye(c),~~(1:r)') One byte was shaved off: thanks to Luis Mendo :)

LISP, 86 bytes (defun g(n m)(if(= n m)(list n)(if(< m n)(cons m(reverse(cons n(g(- n 1)(+ m 1)))))))) The inputs of the function allow to choose the start (m) and the end (n) values of the ...

Python 3, 54 bytes Another Python solution: the mandatory solution using lambda was missing :) lambda y:[f(e for e in y if e*0==0)for f in (min,max)] Try it online! -10 bytes thanks to aeh5040