Fall SalePremium questions, over 25% offUnlock all premium questions for over 25% off
Lowercase Before Uppercase Letter Count
Medium
Question
Each character of s is a letter, written in lowercase or in uppercase. Treating 'x' and 'X' as the same letter, count how many distinct letters satisfy this condition: no lowercase copy of the letter shows up after the first uppercase copy of it. Whenever a letter is used in a single case throughout s, there is nothing to compare, and it meets the condition by default.
...
Asked at:Microsoft
More Microsoft interview questions
- Minimum Adjacent Swaps for Ball Groupingmedium
- Office Gift Delivery Schedulerhard
- Group Elements by Common Propertiesmedium
- Largest Shared BST Valuemedium
- Minimum Coins to Cover All Amountsmedium
- Recent Search History Systemhard
- Count Distinct Elements in Each Windoweasy
- Largest Tree Root IDmedium
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.