A0-indexedstringnumof lengthn +1is created using the following conditions: numconsists of the digits'1'to'9', where each digit is usedat mostonce. Ifpattern[i] =='I', thennum[i] < num[i +1]. Ifpattern[i] =='D', thennum[i] > num[i +1]. Return the lexicographicallysmallestp...