Count Operations to Obtain Zero

Easy
Math Math

Given num1, num2: if num1≥num2 then num1-=num2, else num2-=num1. Count ops until one is 0.

Constraints

0 ≤ num1, num2 ≤ 10^5

Examples

Example 1:
Input: 2 3
Output: 3
Example 2:
Input: 10 10
Output: 1
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.