/**
<p>
Given a set of <b>distinct</b> positive integers, find the largest subset such that every pair (S<sub>i</sub>, S<sub>j</sub>) of elements in this subset satisfies: S<sub>i</sub> % S<sub>j</sub> = 0 or S<sub>j</sub> % S<sub>i</sub> = 0.
</p>

<p>If there are multiple solutions, return any subset is fine.
</p>

<p><b>Example 1:</b>
<pre>
nums: [1,2,3]

Result: [1,2] (of course, [1,3] will also be ok)
</pre>
</p>

<p><b>Example 2:</b>
<pre>
nums: [1,2,4,8]

Result: [1,2,4,8]
</pre>
</p>

<p><b>Credits:</b><br />Special thanks to <a href="https://leetcode.com/stomach_ache">@Stomach_ache</a> for adding this problem and creating all test cases.</p><p>给出一个由<strong>无重复的</strong>正整数组成的集合, 找出其中最大的整除子集, 子集中任意一对 (S<sub>i</sub>, S<sub>j</sub>) 都要满足: S<sub>i</sub> % S<sub>j</sub> = 0 或 S<sub>j</sub> % S<sub>i</sub> = 0。</p>

<p>如果有多个目标子集，返回其中任何一个均可。</p>

<p><strong>示例 1:</strong></p>

<pre>
集合: [1,2,3]

结果: [1,2] (当然, [1,3] 也正确)
</pre>

<p><strong>&nbsp;示例 2:</strong></p>

<pre>
集合: [1,2,4,8]

结果: [1,2,4,8]
</pre>

<p><strong>致谢：</strong><br />
特别感谢&nbsp;<a href="https://leetcode.com/stomach_ache">@Stomach_ache</a>&nbsp;添加这道题并创建所有测试用例。</p>
<p>给出一个由<strong>无重复的</strong>正整数组成的集合, 找出其中最大的整除子集, 子集中任意一对 (S<sub>i</sub>, S<sub>j</sub>) 都要满足: S<sub>i</sub> % S<sub>j</sub> = 0 或 S<sub>j</sub> % S<sub>i</sub> = 0。</p>

<p>如果有多个目标子集，返回其中任何一个均可。</p>

<p><strong>示例 1:</strong></p>

<pre>
集合: [1,2,3]

结果: [1,2] (当然, [1,3] 也正确)
</pre>

<p><strong>&nbsp;示例 2:</strong></p>

<pre>
集合: [1,2,4,8]

结果: [1,2,4,8]
</pre>

<p><strong>致谢：</strong><br />
特别感谢&nbsp;<a href="https://leetcode.com/stomach_ache">@Stomach_ache</a>&nbsp;添加这道题并创建所有测试用例。</p>
**/


class Solution {
    fun largestDivisibleSubset(nums: IntArray): List<Int> {
        
    }
}
/**
<p>
Given a set of <b>distinct</b> positive integers, find the largest subset such that every pair (S<sub>i</sub>, S<sub>j</sub>) of elements in this subset satisfies: S<sub>i</sub> % S<sub>j</sub> = 0 or S<sub>j</sub> % S<sub>i</sub> = 0.
</p>

<p>If there are multiple solutions, return any subset is fine.
</p>

<p><b>Example 1:</b>
<pre>
nums: [1,2,3]

Result: [1,2] (of course, [1,3] will also be ok)
</pre>
</p>

<p><b>Example 2:</b>
<pre>
nums: [1,2,4,8]

Result: [1,2,4,8]
</pre>
</p>

<p><b>Credits:</b><br />Special thanks to <a href="https://leetcode.com/stomach_ache">@Stomach_ache</a> for adding this problem and creating all test cases.</p><p>给出一个由<strong>无重复的</strong>正整数组成的集合, 找出其中最大的整除子集, 子集中任意一对 (S<sub>i</sub>, S<sub>j</sub>) 都要满足: S<sub>i</sub> % S<sub>j</sub> = 0 或 S<sub>j</sub> % S<sub>i</sub> = 0。</p>

<p>如果有多个目标子集，返回其中任何一个均可。</p>

<p><strong>示例 1:</strong></p>

<pre>
集合: [1,2,3]

结果: [1,2] (当然, [1,3] 也正确)
</pre>

<p><strong>&nbsp;示例 2:</strong></p>

<pre>
集合: [1,2,4,8]

结果: [1,2,4,8]
</pre>

<p><strong>致谢：</strong><br />
特别感谢&nbsp;<a href="https://leetcode.com/stomach_ache">@Stomach_ache</a>&nbsp;添加这道题并创建所有测试用例。</p>
<p>给出一个由<strong>无重复的</strong>正整数组成的集合, 找出其中最大的整除子集, 子集中任意一对 (S<sub>i</sub>, S<sub>j</sub>) 都要满足: S<sub>i</sub> % S<sub>j</sub> = 0 或 S<sub>j</sub> % S<sub>i</sub> = 0。</p>

<p>如果有多个目标子集，返回其中任何一个均可。</p>

<p><strong>示例 1:</strong></p>

<pre>
集合: [1,2,3]

结果: [1,2] (当然, [1,3] 也正确)
</pre>

<p><strong>&nbsp;示例 2:</strong></p>

<pre>
集合: [1,2,4,8]

结果: [1,2,4,8]
</pre>

<p><strong>致谢：</strong><br />
特别感谢&nbsp;<a href="https://leetcode.com/stomach_ache">@Stomach_ache</a>&nbsp;添加这道题并创建所有测试用例。</p>
**/


class Solution {
    fun largestDivisibleSubset(nums: IntArray): List<Int> {
        
    }
}