24. Hashで def popcount_hash hash = {'x00' => 0, 'x01' => 1, 'x02' => 1, 'x03' => 2, 'x04' => 1, 'x05' => 2, 'x06' => 2, 'a' => 3, 'b' => 1, 't' => 2, 'n' => 2, 'v' => 3, 'f' => 2, 'r' => 3, 'x0E' => 3, 'x0F' => 4, 'x10' => 1, 'x11' => 2, 'x12' => 2, 'x13' => 3, 'x14' => 2, 'x15' => 3, 'x16' => 3, 'x17' => 4, 'x18' => 2, 'x19' => 3, 'x1A' => 3, 'e' => 4, 'x1C' => 3, 'x1D' => 4, 'x1E' => 4, 'x1F' =>
![拡張ライブラリ作成による高速化](https://cdn-ak-scissors.b.st-hatena.com/image/square/f84e972bc1cec3b114621a1a41ceb8edc83363d7/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Frandom-110813225407-phpapp01-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)