First recurring character

Question

Write a function that returns the first recurring character in a given string. If a string does not have a recurring character, return "No repeated characters". Examples below:

Example 1:
Input = "aclksk"
Output = k

Example 2:
Input = "qwertyuio"
Output = No repeated characters

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now