Dsa
Math
Easy
Greatest Common Divisor
Write a function to compute the greatest common divisor (GCD) of a list of integers. The input will consist of a single line with space-separated integers. The output should be a single integer which is the GCD of the input integers.
Example:
Input:
12 15 9
Output:
3
Key concepts
mathgcdfunctions
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now