Day 464
Closed this issue · 1 comments
vaskoz commented
Good morning! Here's your coding interview problem for today.
This problem was asked by Google.
Given a set of distinct positive integers, find the largest subset such that every pair of elements in the subset (i, j)
satisfies either i % j = 0
or j % i = 0
.
For example, given the set [3, 5, 10, 20, 21]
, you should return [5, 10, 20]
. Given [1, 3, 6, 24]
, return [1, 3, 6, 24]
.