2014 S class让我心寒啊 (转载)# Joke - 肚皮舞运动
u*o
1 楼
60分钟就一道题,design一个function to find duplicate files
input是一个path 比如 C: or /home/users/anne
这个function会return所有有duplicates的file
column 1: file name
column 2: file size...
column 3: number of files with the same file contents
column 4: total space would be saved...
好难哪。。想了半天就想了个用sort先sort size,file size一样的再进行下一步比较。
比较contents得用hash吧,然后...就没有然后了。。。
对这种design的题完全傻眼呀。。。算了爱咋咋地吧。
input是一个path 比如 C: or /home/users/anne
这个function会return所有有duplicates的file
column 1: file name
column 2: file size...
column 3: number of files with the same file contents
column 4: total space would be saved...
好难哪。。想了半天就想了个用sort先sort size,file size一样的再进行下一步比较。
比较contents得用hash吧,然后...就没有然后了。。。
对这种design的题完全傻眼呀。。。算了爱咋咋地吧。