Count different no of paths using all possible ways
INDENT for i in range ( 1 , min ( X , n ) + 1 ) : NEW_LINE INDENT ans = ans + findTotalPath ( X - i , n , dp ) % mod ; NEW_LINE ans %= mod ; NEW_LINE DEDENT DEDENT