> For the complete documentation index, see [llms.txt](https://coding-9.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coding-9.gitbook.io/untitled/insights-and-new-learnings/gcd-of-two-numbers.md).

# GCD of two numbers

## Problem Statement

## Intuition

```
Appraoch:

GCD (a,b) = GCd(a-b, b) = Gcd(a%b, b) where a>b
The moment we get one of zero we return other


Time Comp = O(logbase(phi){min(a,b)})
```

### Links

### Video Links

<https://www.youtube.com/watch?v=1xNbjMdbjug&ab_channel=takeUforward>

### Approach 1:

```
```

{% code title="C++" lineNumbers="true" %}

```cpp
```

{% endcode %}

### Approach 2:

```
```

{% code title="C++" lineNumbers="true" %}

```cpp
```

{% endcode %}

### Approach 3:

```
```

{% code title="C++" lineNumbers="true" %}

```cpp
```

{% endcode %}

### Approach 4:

```
```

{% code title="C++" lineNumbers="true" %}

```cpp
```

{% endcode %}

### Similar Problems

###
