Problem · String
Count Characters Before Uppercase
Learn this problemProblem statement
Given a string of letters, containing both uppercase and lowercase letters, return the number of different characters where all lowercase of that character appear before any uppercase letter.
Function
countCharactersBeforeUppercase(s: String) → intExamples
Example 1
s = "aaAbcCABBc"return = 2Here the output is 2, a and b, c iss not counted.