Company: Amazon_13sep
Difficulty: medium
Retrieve Missing Data Problem Description The Data Science Team at Amazon is facing a unique challenge. A portion of their data has gone missing from their database. However, they believe they can recover the lost data based on the following information: The missing data is a permutation of the characters found in the string firstInfo . The missing data is lexicographically greater than the string secondInfo . The missing data is the lexicographically smallest string that satisfies the above two conditions. In other words, they are searching for the smallest string that meets these criteria. A string x is lexicographically smaller than a string y if: x[i] < y[i] at the first position where x and y differ, or |x| < |y| and x is a prefix of y (where |x| denotes the length of string x). Given two strings, firstInfo and secondInfo , find the missing data that matches the above criteria. If no such string exists, return "-1". Examples Example 1: Input: firstInfo = "aca", secondInfo =