⌘K
Flycodx

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
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
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3