You are on page 1of 2
611812020 TCS: CodeVita- Coding Arena Ajay Ravuri © O3Hr 58 Min 07 sec Guidelines Coding Area Editor | Compile & Run History ‘Submissions Unevaluated ‘Submissions ‘Submission History Feedback Form Graphs Coding Area Lexi String + Problem Description A B c D E F Little Jill jumbled up the order of the letters in our dictionary. Now, Jack uses this list to find the smallest lexicographical string that can be made out of this new order. Can you help him? You are given a string P that denotes the new order of letters in the English dictionary. You need to print the smallest lexicographic string made from the given string S. Constraints <= T<= 1000 Length (P) = 26 11<= length (S) <= 100 All characters in the string S, P are in lowercase + Input Format The first line contains number of test cases T The second line has the string P The third line has the string S + Output Print a single string in a new line for every test case giving the result + Time Limit 1 + Explanation hitpspractice tescadeuita.comllTimain_page jsp ONLINE EDITOR (E) 42 611812020 TCS: CodeVita- Coding Arena Example 1 Input 2 polikujmnhytgbvtredexswaaz abed qwryupesfoghikidezxvbintma ativedor Output bdea codevita Explanation ‘The transformed smallest lexicographical strings are in order they would b order of letters are changed to string P Upload Solution [ Question : E} OL Ajay Ravuri confirm that the answer (Took help from online sources submitted is my own, (attributions) CodeVita FAQs About CodeVita Privacy Policy Careers © 2020 Tata Consultancy Services Limited, All Rights Reserved hitpspractice tescadeuita.comllTimain_page jsp 22

You might also like