Count the Number of Special Characters I

You are given a string word. A letter is called special if it appears both in lowercase and uppercase in word.

Return the number of special letters in word.

Example 1
Inputword = "aaAbcBC"
Output3
The special characters in word are 'a', 'b', and 'c'.
Example 2
Inputword = "abc"
Output0
No character in word appears in uppercase.

Constraints

  • 1 <= word.length <= 50
  • word consists of only lowercase and uppercase English letters.

Asked at 2 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate