Re: [閒聊] 每日leetcode

作者: DJYOMIYAHINA (通通打死)   2025-12-10 23:08:23
純純白癡問題
想了想才發現隨便排== 反正每個都要可以被第一個解碼
如果第一個並非單獨最小值 就怎樣都解不了
def countPermutations(self, complexity: List[int]) -> int:
if min(complexity[1:])<=complexity[0]:
return 0
else:
n = len(complexity)-1
rets = 1
mod = 10**9 + 7
while n>0:
rets = (rets*n) % mod
n -= 1
return rets
作者: oin1104 (是oin的說)   2025-12-10 23:10:00
這我寫完之後覺得自己超白癡 媽的
作者: wwndbk (黑人問號)   2025-12-10 23:12:00
這題好像有印象
作者: sustainer123 (caster)   2025-12-10 23:20:00
大師

Links booklink

Contact Us: admin [ a t ] ucptt.com