This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Description
Description of the Problem
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies:
Si % Sj = 0 or Sj % Si = 0.
If there are multiple solutions, return any subset is fine.
Code
class Solution:
def largestDivisibleSubset(self, nums: List[int]) -> List[int]:
Link To The LeetCode Problem
Largest Divisible Subset