/* 自定義代碼塊樣式 */

herrDeng網內搜尋

自訂搜尋

Ads

2025年12月10日 星期三

py3 C C++階乘模運算速解Leetcode 3577 Count the Number of Computer Unlocking Pe...


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)

沒有留言:

Related Posts Plugin for WordPress, Blogger...

熱門文章