py3 C C++階乘模運算速解Leetcode 3577 Count the Number of Computer Unlocking Permutations
[1-liner Py3請進]
class Solution:
def countPermutations(self, x: List[int]) -> int:
return 0 if x[0]>=min(x[1:]) else factorial(len(x)-1)%(10**9+7)
/* 自定義代碼塊樣式 */
class Solution:
def countPermutations(self, x: List[int]) -> int:
return 0 if x[0]>=min(x[1:]) else factorial(len(x)-1)%(10**9+7)
沒有留言:
張貼留言