递归一下
class Solution:
def countOperations(self, num1: int, num2: int) -> int:
self.res = 0
def helper(num1, num2):
if num1 == 0 or num2 == 0:return self.res
if num1 >= num2:
num1 -= num2
else:
num2 -= num1
#print(num1)
#print(num2)
#print("**")
self.res += 1
helper(num1, num2)
helper(num1, num2)
return self.res


![Leetcode 2169. Count Operations to Obtain Zero [Python] Leetcode 2169. Count Operations to Obtain Zero [Python]](http://www.mshxw.com/aiimages/31/969279.png)
