No.2778 Is there Same letter?
タグ : / 解いたユーザー数 179
作問者 :
amentorimaru
👑 Story
Now, let us talk about Yu~-san's past.
Yu~-san has no good memories of romantic relationships.
On top of that, having had almost nothing to do with girls during high school and university, Yu~-san became terribly twisted.
Yes, Yu~-san can no longer tolerate compatible people being in the same space. The same goes for strings.
In other words, Yu~-san cannot tolerate a string containing multiple occurrences of the same letter.
Your job is to determine whether a given string is one that Yu~-san will tolerate or not, before it comes into Yu~-san's sight.
Problem Statement
You are given a string $S$ of $N$ characters.
Determine whether the same letter appears $2$ or more times in the string $S$.
More strictly, it is as follows.
Input
$N$ $S$
Constraints
- $N$ is an integer.
- $S$ is a string consisting of uppercase English letters.
- $2\leqq N\leqq 26$
- $|S| = N$
Output
Print Yes if the same letter appears $2$ or more times, and No otherwise.
Print a newline at the end.
Sample
Sample 1
Input
5 TOKYO
Output
Yes
Since O appears $2$ times, print Yes.
Sample 2
Input
7 ATCODER
Output
No
No letter appears $2$ or more times in ATCODER.
Sample 3
Input
19 QAWSEDRFTGYHUJIKOLP
Output
No
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。