Architected solver for the hamming-distances clustering problem