complete_common_string: Optimize common string search

Start from short to long.  Use at least len of previously found
complete_str.