这道题似乎只有HashMap这么一个解法
HashMap<> key是contents, value是list of file path with same contents.
Follow-up的问题比较难。 因为file contents 可以很大,如果用来当Hash key 不行的。
BFS一般比DFS用更多的Memory? 是因为Queue的原因吗?Locality 。
现实中mapping key用的是File size. size不一样的内容肯定不一样。size一样的 内容也可能不一样。所以hash a small part of file with equal sizes. 当Hash值一样,我们compare the file byte by byte.
最难的是split content "\\(" 部分,一开始没有想到