Use algorithm from Kamil:
Use algorithm from Kamil:

Excluding sorting, this is O(n) which should be much faster and
much simpler and easier to understand.

dreampet/gitlab,icedwater/gitlabhq,shinexiao/gitlabhq,htve/GitlabForChinese,axilleas/gitlabhq,daiyu/gitlab-zh,iiet/iiet-git,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq,shinexiao/gitlabhq,SVArago/gitlabhq,shinexiao/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,stoplightio/gitlabhq,allysonbarros/gitlabhq,openwide-java/gitlabhq,darkrasid/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,LUMC/gitlabhq,stoplightio/gitlabhq,htve/GitlabForChinese,dreampet/gitlab,t-zuehlsdorff/gitlabhq,dplarson/gitlabhq,axilleas/gitlabhq,axilleas/gitlabhq,screenpages/gitlabhq,htve/GitlabForChinese,shinexiao/gitlabhq,LUMC/gitlabhq,daiyu/gitlab-zh,allysonbarros/gitlabhq,darkrasid/gitlabhq,jirutka/gitlabhq,darkrasid/gitlabhq,dreampet/gitlab,openwide-java/gitlabhq,LUMC/gitlabhq,dplarson/gitlabhq,dreampet/gitlab,mmkassem/gitlabhq,screenpages/gitlabhq,SVArago/gitlabhq,screenpages/gitlabhq,darkrasid/gitlabhq,jirutka/gitlabhq,icedwater/gitlabhq,openwide-java/gitlabhq,allysonbarros/gitlabhq,daiyu/gitlab-zh,jirutka/gitlabhq,htve/GitlabForChinese,allysonbarros/gitlabhq,SVArago/gitlabhq,openwide-java/gitlabhq,icedwater/gitlabhq,stoplightio/gitlabhq,dplarson/gitlabhq,screenpages/gitlabhq,LUMC/gitlabhq,dplarson/gitlabhq,t-zuehlsdorff/gitlabhq,SVArago/gitlabhq,axilleas/gitlabhq,icedwater/gitlabhq,jirutka/gitlabhq,daiyu/gitlab-zh,iiet/iiet-git,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq