A secret permutation of integers from s of length i:
s[i] == 'I' indicates that the permutation satisfies perm[i] < perm[i + 1] (increasing).
s[i] == 'D' indicates that the permutation satisfies perm[i] > perm[i + 1] (decreasing).
Given the encoded string s, reconstruct and return the lexicographically smallest valid permutation.
Constraints:
s.length
s[i] is either 'I' or 'D'.
A secret permutation of integers from s of length i:
s[i] == 'I' indicates that the permutation satisfies perm[i] < perm[i + 1] (increasing).
s[i] == 'D' indicates that the permutation satisfies perm[i] > perm[i + 1] (decreasing).
Given the encoded string s, reconstruct and return the lexicographically smallest valid permutation.
Constraints:
s.length
s[i] is either 'I' or 'D'.