VERITAS TECHNOLOGIES Hiring Question | Online Assessment(2023)
Veritas · Question · Posted Jun 2026
Problem Statement You are given an array nums containing distinct positive integers. A subset of nums is called a divisible subset if for every pair of elements (a, b) in the subset, either: a % b == 0, or b % a == 0 Your task is to return the largest divisible subset possible. If there are multiple valid answers, return any one of them. Example 1 Input nums = [1,2,3] Output [1,2] Explanation Both [1,2] and [1,3] are valid ...
The full answer & interview discussion are available to premium members.
Log in Create a free account