Daily challenge for 2026-05-06
491. Alternating Case Score
Given a string s, calculate a score based on the case of its characters. The first character always adds 1 to the score. For each later character, add 2 if its case (uppercase vs lowercase) is different from the previous character, otherwise add 1. Non-alphabetic characters count as having no case and still add 1 point.
Example:Input: s = "A B"Output: 3
Explanation: 'A' adds 1. The space adds 1. 'B' is uppercase like the most recent alphabetic character, so it adds 1 more. The total score is 3.
Run this challenge interactively in Python or JavaScript when the app loads.