A permutation perm of s of length
perm[i] < perm[i + 1] if s[i] == 'I'
perm[i] > perm[i + 1] if s[i] == 'D'
Given a string s, reconstruct and return any valid permutation perm. If there are multiple valid permutations, return any of them.
Constraints:
s.length
s[i] is either 'I' or 'D'.
A permutation perm of s of length
perm[i] < perm[i + 1] if s[i] == 'I'
perm[i] > perm[i + 1] if s[i] == 'D'
Given a string s, reconstruct and return any valid permutation perm. If there are multiple valid permutations, return any of them.
Constraints:
s.length
s[i] is either 'I' or 'D'.