Skip to content

Commit 1d1df5b

Browse files
committed
gcd_recurseive
Signed-off-by: Saurabh Misra <[email protected]>
1 parent ec531ba commit 1d1df5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

codeflash/result/code.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def gcd_recursive(a: int, b: int) -> int:
2+
"""Calculate greatest common divisor using Euclidean algorithm with recursion."""
3+
if b == 0:
4+
return a
5+
return gcd_recursive(b, a % b)

0 commit comments

Comments
 (0)