GOKWIK Hiring Challenge | Off-Campus Online Assessment (2024)
Question · Posted Jun 2026
Find Greatest Common Divisor of Array Problem Statement Given an integer array nums, find the smallest and largest elements in the array. Return the Greatest Common Divisor (GCD) of these two numbers. Example Input nums = [2,5,6,9,10] Output 2 Constraints 2 <= nums.length <= 1000 1 <= nums[i] <= 1000 Test Cases Test Case 1 Input nums = [2,5,6,9,10] Output 2 Test Case 2 Input nums = [7,5,6,8,3] Output 1
The full answer & interview discussion are available to premium members.
Log in Create a free account