> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0477_total_hamming_distance/slt.md).

# Solution1 乘法原理

* 时间复杂度 O(n \* C) C 为常数 30
* 空间复杂度 O(1)

设第 i 列比特位有 s1 个 1, s2 个 0

则 s1 中的每个 1 都有 s2 个 0 与之不同，所以对于第 i 位，汉明距离就是 s1 \* s2
