Extract School Subject Grades
Extract School Subject Grades
MediumStrings0% accepted
Bangalore schools encode semester grades as continuous strings where each character represents a subject-grade pair using format: SUBJECT_CODE+GRADE. Subject codes are capital letters (A-Z), grades are A-F. Ravi needs to count all subjects with 'A' grade.
Approach
Given a space-separated string of subject-grade pairs (e.g., 'AA BE CDA'), count how many subjects have 'A' grade (where each pair is subject_code followed by grade).
Input
AA BE CA DF GA
Output
3
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards