← ALL NOTES
String

2375. Construct Smallest Number From DI String

Given a string pattern of 'I' and 'D' of length m, build the lexicographically smallest number of length m+1 using distinct digits 1..9, such that at 'I' positions the digit increases (num[i] <…

Loading…