Dsa
Math
Easy
Finding GCD of All Elements
Given a list of positive integers, find the greatest common divisor (GCD) of all elements in the list.
Input:
- A single line containing space-separated positive integers.
Output:
- An integer representing the GCD of the given integers.
Example:
Input:
12 15 9
Output:
3
Key concepts
mathgcdarray
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