Tap here to switch tabs
Problem
Submissions

Problem: Count Operations to Obtain Zero

med
30 min
Try to solve the Count Operations to Obtain Zero problem.

Statement

You are given two non-negative integers num1 and num2.

In a single operation, if num1 ≥\geq num2, subtract num2 from num1. Otherwise, subtract num1 from num2.

Return the number of operations required to make either num1 =0= 0 or num2 =0= 0.

Constraints:

  • 0≤0 \leq num1, num2 ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Operations to Obtain Zero

med
30 min
Try to solve the Count Operations to Obtain Zero problem.

Statement

You are given two non-negative integers num1 and num2.

In a single operation, if num1 ≥\geq num2, subtract num2 from num1. Otherwise, subtract num1 from num2.

Return the number of operations required to make either num1 =0= 0 or num2 =0= 0.

Constraints:

  • 0≤0 \leq num1, num2 ≤105\leq 10^5