Skip to main content
Commonmark migration
Source Link

#JavaScript (ES6),  92  74 bytes

JavaScript (ES6),  92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>r=>[...b.map((n,i)=>n.repeat(+n&&3-i)).join``].sort()+''==[...r].sort()

Try it online!


#JavaScript (ES6), 74 bytes

JavaScript (ES6), 74 bytes

Takes input as (gold, silver, bronze, 'rep'). Returns a Boolean value.

(g,s,b,r)=>(F=s=>[...s].sort()+0)(r)==F([g,g,g,s,s,b].filter(x=>x).join``)

Try it online!

#JavaScript (ES6),  92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>r=>[...b.map((n,i)=>n.repeat(+n&&3-i)).join``].sort()+''==[...r].sort()

Try it online!


#JavaScript (ES6), 74 bytes

Takes input as (gold, silver, bronze, 'rep'). Returns a Boolean value.

(g,s,b,r)=>(F=s=>[...s].sort()+0)(r)==F([g,g,g,s,s,b].filter(x=>x).join``)

Try it online!

JavaScript (ES6),  92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>r=>[...b.map((n,i)=>n.repeat(+n&&3-i)).join``].sort()+''==[...r].sort()

Try it online!


JavaScript (ES6), 74 bytes

Takes input as (gold, silver, bronze, 'rep'). Returns a Boolean value.

(g,s,b,r)=>(F=s=>[...s].sort()+0)(r)==F([g,g,g,s,s,b].filter(x=>x).join``)

Try it online!

added another version
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

#JavaScript (ES6),  92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>r=>[...b.map((n,i)=>n.repeat(+n&&3-i)).join``].sort()+''==[...r].sort()

Try it online!


#JavaScript (ES6), 74 bytes

Takes input as (gold, silver, bronze, 'rep'). Returns a Boolean value.

(g,s,b,r)=>(F=s=>[...s].sort()+0)(r)==F([g,g,g,s,s,b].filter(x=>x).join``)

Try it online!

#JavaScript (ES6),  92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>r=>[...b.map((n,i)=>n.repeat(+n&&3-i)).join``].sort()+''==[...r].sort()

Try it online!

#JavaScript (ES6),  92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>r=>[...b.map((n,i)=>n.repeat(+n&&3-i)).join``].sort()+''==[...r].sort()

Try it online!


#JavaScript (ES6), 74 bytes

Takes input as (gold, silver, bronze, 'rep'). Returns a Boolean value.

(g,s,b,r)=>(F=s=>[...s].sort()+0)(r)==F([g,g,g,s,s,b].filter(x=>x).join``)

Try it online!

saved 18 bytes
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

#JavaScript (ES6), 92 92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>F=([c,b=>r=>[...a],x=bb.map((n,i)=>n.repeat(+n&&3-i)).join``)=>c?(X=xjoin``].replacesort(c,''))!=x&F+''==[...r].sort(a,X):!x

Try it online!Try it online!

#JavaScript (ES6), 92 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>F=([c,...a],x=b.map((n,i)=>n.repeat(+n&&3-i)).join``)=>c?(X=x.replace(c,''))!=x&F(a,X):!x

Try it online!

#JavaScript (ES6),  92  74 bytes

Takes input as (['gold','silver','bronze'])('rep'). Returns a Boolean value.

b=>r=>[...b.map((n,i)=>n.repeat(+n&&3-i)).join``].sort()+''==[...r].sort()

Try it online!

Post Undeleted by Arnauld
fixed version
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650
Loading
Post Deleted by Arnauld
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650
Loading