Problem : Link
In a race there are n horses. You have to output the number of ways the race can finish. Note that, more than one horse may get the same position. For example, 2 horses can finish in 3 ways. - - Both first - horse1 first and horse2 second - horse2 first and horse1 second
My Idea is just Count all the way , there are two case when position are same or position increment of horse.
But it fails , But Why ?
Can anyone explain why my idea fail and describe about the idea above or give a solution idea .
Thanks in advanced :)