Quantcast
Channel: Do you make me up? - Code Golf Stack Exchange
Browsing all 54 articles
Browse latest View live

Answer by Night2 for Do you make me up?

PHP (7.4), 26 bytes fn($a,$b)=>!strtok($b,$a); Try it online! PHP's strtok, basically removes characters of its second parameter, form its first parameter and returns the result or false if the...

View Article



Answer by GammaFunction for Do you make me up?

Zsh, 35 bytes a=(${(s::)1}) ((!${#${(s::)2}:|a})) Try it online! ${(s::)2} # split second parameter into characters ${ :|a} # remove all elements of $a ${# } # count ((! )) # return truthy if 0, falsy...

View Article

Answer by Neil for Do you make me up?

Charcoal, 5 bytes ⬤η№θι Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. - for true, nothing for false. Explanation: ⬤ All of η Second string № Count (is non-zero) in...

View Article

Answer by Luis Mendo for Do you make me up?

MATL, 2 bytes mA Inputs should be provided in reverse order. Try it online! Or verify all test cases. Explanation The code implicitly takes two strings as inputs and verifies if All the characters in...

View Article

Answer by Nick Kennedy for Do you make me up?

Jelly, 3 bytes fƑ@ Try it online! A dyadic link taking two strings and returning a Boolean. If the order of the input s can be reversed, I could save one byte.

View Article


Answer by Jonah for Do you make me up?

J, 5 bytes */@e. Try it online! Is each char of the 2nd string an element of e. the 1st string? This returns a boolean mask, whose elements we multiply together with */. J is smart about 0 values so...

View Article

Answer by randomdude999 for Do you make me up?

Japt -!, 15 10 5 bytes k@VøX Try it online! Thanks to @Shaggy for -5.

View Article

Answer by xnor for Do you make me up?

Python 3, 21 bytes lambda a,b:{*a}>={*b} Try it online!

View Article


Answer by xnor for Do you make me up?

Haskell, 13 bytes all.flip elem Try it online! Haskell doesn't have built-in set or subset functions, so we need to do it ourselves. This is a pointfree version of 17 bytes a%b=all(`elem`a)b Try it...

View Article


Answer by Unrelated String for Do you make me up?

Brachylog, 3 bytes dp⊆ Try it online! Takes string 1 as the output variable and string 2 as the input variable.

View Article

Answer by randomdude999 for Do you make me up?

Pyth, 7 bytes g.{w.{w Try it online! First string on first line of input, second string on second line.

View Article

Answer by Arnauld for Do you make me up?

JavaScript (ES6), 31 bytes Takes arrays of characters as input. a=>b=>b.every(c=>a.includes(c)) Try it online! 25 bytes For the record, below is my original answer, which was designed for...

View Article

Answer by Jono 2906 for Do you make me up?

Python 3, 28 bytes lambda x,y:not set(y)-set(x) Try it online! Simply turns the two inputs into sets and subtracts the sets from each other

View Article


Do you make me up?

Introduction Every string has an "alphabet", composed of the characters that make it up. For example, the alphabet of \$abcaabbcc\$ is \${a, b,c}\$. There are two operations you can do with alphabets:...

View Article

Answer by Jono 2906 for Do you make me up?

Keg, 13 7 bytes (SBCS)᠀᠀^-``= Try it online!Transpiles to:from KegLib import * from Stackd import Stack stack = Stack() printed = False string_input(stack) string_input(stack) reverse(stack)...

View Article


Answer by Robin Ryder for Do you make me up?

R, 40 bytesfunction(x,y,`+`=utf8ToInt)all(+y%in%+x) Try it online!

View Article

Answer by Embodiment of Ignorance for Do you make me up?

Japt-!, 3 bytesVkU Try itVkU U = first string, V = second Vk Remove all characters in V U that are present in U -! If the string is empty, return true, else false

View Article


Answer by juancho for Do you make me up?

Haskell, 24 bytesf a b=all(\c->elem c a)b Try it online!

View Article

Answer by LMD for Do you make me up?

Lua, 114 bytesd=function(a,c,v)for _,k in ipairs(a) do c[k]=v end end function l(a,b)c={};d(b,c,1);d(a,c);return not next(c) end Try it online!Couldn't get it shorter with plain Lua because lightweight...

View Article

Answer by wizzwizz4 for Do you make me up?

Rust, 106 104 bytes|a:&str,b:&str|{let c=|x:&str|x.chars().collect::<std::collections::HashSet<_>>();c(b).is_subset(&c(a))} Try it online!-2 bytes because On a technical...

View Article
Browsing all 54 articles
Browse latest View live




Latest Images