java - Counting length-2 substrings that are common to two