Place King problem: dynamic solution using a hash table

It turns out that the performance is very poor. The reason is not clear.