Please help . Getting Wrong answers for even test case!!! link to my code -> http://ideone.com/lU40Sl
just do a diff… its your code with correction…
a couple of bad initialization and wrong variable output in the end and a wrong data type for ways(shd be long long int)
Thank you very much. My bad …did silly mistakes.