GCD Of Array
Computer Mathematics
Medium
3 views
Problem Description
Given n and n integers, print gcd of all numbers.
Input Format
n then n integers.
Output Format
One integer gcd.
Official Solution
Start g=0 and set g=gcd(g,ai) for each element.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!