Question: 
Write a function to calculate the permutation coefficient of given p(n, k).


Model's Code:
def permutation_coefficient(n, k):
    if k > n or k < 0:
        return 0
    result = 1
    for i in range(k):
        result *= (n - i)
    return result



Sample Correct Code:
def permutation_coefficient(n, k): 
	P = [[0 for i in range(k + 1)] 
			for j in range(n + 1)] 
	for i in range(n + 1): 
		for j in range(min(i, k) + 1): 
			if (j == 0): 
				P[i][j] = 1
			else: 
				P[i][j] = P[i - 1][j] + ( 
						j * P[i - 1][j - 1]) 
			if (j < k): 
				P[i][j + 1] = 0
	return P[n][k] 


Asserts:
assert permutation_coefficient(10, 2) == 90
assert permutation_coefficient(10, 3) == 720
assert permutation_coefficient(10, 1) == 10


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 506 of 974: 374/506 (73.91304347826086%): success