You are given a string word. A letter c is called a special character if both its lowercase and uppercase forms appear in word, and every lowercase occurrence of c appears strictly before the first uppercase occurrence of c.
Return the total number of special characters in word.
Constraints:
word.length
word consists of only lowercase and uppercase English letters.
You are given a string word. A letter c is called a special character if both its lowercase and uppercase forms appear in word, and every lowercase occurrence of c appears strictly before the first uppercase occurrence of c.
Return the total number of special characters in word.
Constraints:
word.length
word consists of only lowercase and uppercase English letters.