Skip to main content
Wrapped into a lambda; included test part.
Source Link

Ruby, 1927 bytes

f=->*a{a.map{|e|a.count e}} 

Testing:

p f[4,3,4] #=> [2, 1, 2] 

Ruby, 19 bytes

a.map{|e|a.count e} 

Ruby, 27 bytes

f=->*a{a.map{|e|a.count e}} 

Testing:

p f[4,3,4] #=> [2, 1, 2] 
added 2 characters in body
Source Link
hyperneutrino
  • 42.8k
  • 5
  • 72
  • 227

Ruby, 19 bytes

Ruby, 19 bytes

a.map{|e|a.count e} 

Ruby, 19 bytes

a.map{|e|a.count e} 

Ruby, 19 bytes

a.map{|e|a.count e} 
Source Link

Ruby, 19 bytes

a.map{|e|a.count e}