Problem · String

Count Characters Before Uppercase

EasyMicrosoftFULLTIMEOA
See Microsoft hiring insights

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.

Examples
01 · Example 1
s = "aaAbcCABBc"
return = 2

Here the output is 2, a and b, c iss not counted.

More Microsoft problems
drafts saved locally
public int countCharactersBeforeUppercase(String s) {
  // write your code here
}
s"aaAbcCABBc"
expected2
sign in to submit