Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You took N number of books from the library. You are done reading all the books. Now you have to go to the library and
You took number of books from the library. You are done reading all the books. Now you have to go to the library and keep those books on the bookshelf in their Alphabetically ordered position. But there is a problem. All the other books in the bookshelf are kept without any order and the librarian will sort the books later. But you want to keep your books in such a way that their actual alphabetical position is maintained without sorting all the books. But you might change the other book's position according to your need.
Input
The first line contains an integer denoting the number of books you took from the library. The second line contains an array of Alphabets, denoting your book's name. The third line contains an array of Alphabets, denoting all the other book names which are already kept on the bookshelf without any order.
Output:
Return the array of the books where your books are in their specific position.
NB: Returned array can vary according to your approach. But you have to make sure that all of your books are in their actual alphabetically ordered position.
Sample InputOutput:
tableSample Input Sample Output A C D G E M V S Z PC S MP V D Z G ASample Input Sample Output F C D L K O Y X QX OF D L YKQ
SOLVE USING PYTHON
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started