I’m a newbie in dynamic programming. I saw this question: http://www.codechef.com/problems/PPERM
And when I read the editorial (link), I was a bit confused at this statement: pperm1 = 1
Why have we initialised pperm1 as 1? Shouldn’t pperm1 be n? Because if any number from 1 to n is placed in the 1st position then the condition is satisfied since that number will always be smallest of the 1st ‘1’ numbers according to the question. I’m just a beginner so if I’m wrong, then please correct me