Extract Station Codes from Railway Route
Extract Station Codes from Railway Route
EasyStrings50% accepted
Arjun booked a train ticket on IRCTC and received his journey details with full station names. He wants to convert them to 3-letter codes following Indian Railways standard notation for easy reference.
Approach
Given a comma-separated list of station names, extract the first 3 characters of each name and return them in uppercase separated by commas.
Input
Delhi Central,Mumbai Central,Pune Junction
Output
DEL,MUM,PUN
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