NeetCode #364LC-484MediumStackNC Algo100
← Back to All Problems#364 · #484 · Find Permutation(寻找排列)
📌 Problem Statement & Constraints
A permutation
perm of 1..n can be derived from a string s of length n - 1: s[i] == 'I' means perm[i] < perm[i+1] and s[i] == 'D' means perm[i] > perm[i+1]. Return the lexicographically smallest such permutation. Constraints: 1 <= s.length <= 10^4.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!