Question bank › Sorting
Dsa Sorting Easy

Book Arrangement

You have a collection of book titles, some of which may be duplicates. Your task is to sort the titles in lexicographical order without duplicates and output them. Input format: - The first line contains an integer n (1 <= n <= 1000), the number of book titles. - The next n lines each contain a book title (1 <= title length <= 100). Output format: - Print the unique book titles, each on a new line in sorted order. Example: Input: 4 Harry Potter The Hobbit Harry Potter The Lord of the Rings Output: Harry Potter The Hobbit The Lord of the Rings

Key concepts

sortingstringslexicographical

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.