SumSums one wrong answer on hackerblocks

Question Link
https://hack.codingblocks.com/contests/c/547/846

Code Link

I made recurrence as
f(n)=(L-1)f(n-2) + (L-2)f(n-1)
where L is the length of the array
Passed On Spoj but giving one Wrong Answer on Hackers Block !

I am also getting this one wrong answer.
And my code passed on spoj.

1 Like