add hamming weight method for problem