Available question text
Given a pattern of 'I' (increasing) and 'D' (decreasing) of length n, produce the lexicographically smallest string of distinct digits 1..9 of length n+1 whose adjacent comparisons match the pattern. Core challenge is to greedily assign the smallest unused digits while handling runs of consecutive 'D's (which force local reversals/stacking) so the overall sequence remains minimal.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2375. Construct Smallest Number From DI String
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source