Compute Difference Between Uppercase and Lowercase Letters
Learn this problemProblem statement
Note ->> See the Image Source section at the very bottom of the page for the original problem statement and etc.. đ°đ°
100 years agoo0, a typing practice app wanted to test how well users balanced uppercase and lowercase letters in their entries. For every string a user typed, the app needed to count the number of uppercase and lowercase letters and calculate the difference between themâpositive if uppercase dominated, negative if lowercase took the lead. It didnât mind if the solution wasnât the most efficient, as long as it could handle the text without breaking a sweat, even if it meant checking some letters more than once. With your help, the app could ensure everything stayed consistent and fun!
đ˘Ö´ŕťđˇÍÖ áŠMany thanks to Charlotte babyá°
Function
computeDiff(text: String) â intExamples
Example 1
text = "CodeSignal"return = -6Example 2
text = "a"return = -1Constraints
- 0 ⤠typedText.length ⤠100.