Problem · String
Uppercase-Lowercase Difference
Learn this problemProblem statement
In a typing-practice application, user input is represented by a string typedText containing uppercase and lowercase English letters.
Return the number of uppercase letters minus the number of lowercase letters in typedText.
Function
solution(typedText: String) → intExamples
Example 1
typedText = "CodeSignal"return = -6There are 2 uppercase letters (C and S) and 8 lowercase letters, so the result is 2 - 8 = -6.
Example 2
typedText = "a"return = -1There are no uppercase letters and one lowercase letter, so the result is 0 - 1 = -1.
Constraints
typedTextcontains only uppercase and lowercase English letters.