Leetcode 903. Valid Permutations for DI Sequence DI序列的个数
WearegivenS,alengthnstringofcharactersfromtheset{'D','I'}.(Theselettersstandfor"decreasing"and"increasing".)AvalidpermutationisapermutationP[0],P[1],...,P[n]ofintegers{0,1,...,n},suchthatforalli:IfS[i