Super Duper Easy One Line Soln


#1

vector Solution::findPerm(const string a, int n) {
vector ans;
int l=1,r=n;
for(int i=0;i<n-1;i++){
(a[i]==‘I’?ans.push_back(l++):ans.push_back(r–));
}
ans.push_back(l);
return ans;
}