Bobo has n strings s1, ... , sn, and he would like to find the number of pairs i < j where si + sj = sj + si. Note that a + b means the concatenation of the string a and b, i.e., writing the string a first, and the string b second.
Bobo has n strings s1, ... , sn, and he would like to find the number of pairs i < j where si + sj = sj + si. Note that a + b means the concatenation of the string a and b, i.e., writing the string a first, and the string b second.

(图片来源网络,侵删)