问题原链接 https://leetcode-cn.com/problems/deep-dark-fraction/
python3 解题代码:
class Solution:
def fraction(self, cont: List[int]) -> List[int]:
up = 1
down = 0
for i in range(len(cont)-1,-1,-1):
temp = up
up = cont[i] * up + down
down = temp
return [up, down]
解题思路
网友评论