http://www.nxcoding.com/archives/leetcode-daily-2506-count-similar-string-pairs