Correct the code for counting of subsesquences

I have corrected the code actually you are incrementing the j on both cases https://ide.codingblocks.com/s/121216 you can find the corrected code here…