Sort Library Books Ignoring Articles
Sort Library Books Ignoring Articles
EasyStrings0% accepted
Priya manages the catalog system at Delhi Public Library. Books are titled with leading articles like 'The', 'A', and 'An'. She must sort them alphabetically while ignoring these articles but preserving the original titles in output.
Approach
Given a list of book titles with leading articles, sort alphabetically ignoring 'The', 'A', 'An' at the start, returning the sorted original titles.
Input
["The Great Gatsby", "A Tale of Two Cities", "An Inspector Calls"]
Output
["The Great Gatsby","An Inspector Calls","A Tale of Two Cities"]
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