06_custom_customs.rb
# Only works for 32-bit integers,
# but since there are only 26 letters, it's fine.
Only works for 32-bit integers,
but since there are only 26 letters, it's fine.
Only works for 32 - bit integers but since there are only 26 letters it ' s fine .
def popcount32(v)
  v = v - ((v >> 1) & 0x55555555)
  v = (v & 0x33333333) + ((v >> 2) & 0x33333333)
  (((v + (v >> 4) & 0x0F0F0F0F) * 0x01010101) >> 24) & 0x3f
end
def popcount32 ( v ) v = v - ( ( v >> 1 ) & 0x55555555 ) v = ( v & 0x33333333 ) + ( ( v >> 2 ) & 0x33333333 ) ( ( ( v + ( v >> 4 ) & 0x0F0F0F0F ) * 0x01010101 ) >> 24 ) & 0x3f end
Only works for 32-bit integers,
but since there are only 26 letters, it's fine.
Only works for 32 - bit integers but since there are only 26 letters it ' s fine .
v
<not_specific>