Practice

First Double Letter

MEDIUMString Processing7 marks

Read a word and find the first pair of adjacent matching letters.

The comparison is case-insensitive. Output the matching letter in uppercase. If there is no adjacent pair, output None.

Input: One word. Output: The first repeated adjacent letter in uppercase, or None.

Example:

Input:  book
Output: O
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Double O
Inputs: book
Expected: O
Test 2: First double is ss
Inputs: Mississippi
Expected: S
Test 3: No adjacent repeat
Inputs: abcde
Expected: None