Hospital OPD Appointment Validator
Hospital OPD Appointment Validator
MediumStrings0% accepted
Arjun manages appointments at Apollo Hospital, Delhi. Each appointment is encoded as 'Doctor-Date-TimeSlot' (e.g., 'DR001-15-09'). Count valid appointments where date is 01-31 and time is 09-17 (9 AM to 5 PM).
Approach
Given appointment strings in format 'DR###-DD-HH', count how many have valid date (01-31) and valid hour (09-17).
Input
DR001-15-10,DR002-32-14,DR003-01-09,DR004-25-18
Output
2
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