#3121

Count the Number of Special Characters II

medium · 43.3% accepted · 181 likes · top 25%

hash table · string

⊣ practice⊣ open on leetcode ↗

Description

You are given a string word. A letter c is called special if it appears both in lowercase and uppercase in word, and every lowercase occurrence of c appears before the first uppercase occurrence of c.

Return the number of special letters in word.

Solution