Official

A - Similar String Editorial by en_translator


If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.
Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in “AtCoder Beginners Selection” (https://atcoder.jp/contests/abs).


First and foremost, you need a way to determine if two characters are similar. This can be implemented with an if statement.

Then you need to compare each character of a string to check if each pair is similar characters. This can be implemented with a for statement.

For more details, please see the sample code below.

Sample code (C++):

Sample code (Python):

posted:
last update: