Solve SRM 431, Div 2, Problem DifferentStrings