i have used the concept of SPP but it is not working completely in this case
my code =>https://ide.codingblocks.com/s/240698
Some test case not working
@gagangoyal674
Check this testcase
1
1 1
ans should be “1” but your code is printing “0”.
There is a slight mistake in line no 49, It should be for(int i=0;i<=n;i++) . iterate loop till i<=n