Finding largest subset where each number in any pair one number is divisible by the other
<p>Given an array <em>A</em> of size <em>N</em>. I need to find the size of the Largest Subset in which any pair of elements within the subset, one of them is divisible by the other.</p>

<p>In short, find largest subset <em>S</em>, where <em>∀i,j</em> where <em>i &ne; j</em> and <em>i&lt;|S| and j&lt;|S|</em> either <em>S<sub>i</sub>%S<sub>j</sub>=0</em> or <em>S<sub>j</sub>%S<sub>i</sub>=0</em>.</p>

<p>The <strong>bounds</strong> for the problem are:</p>

<ol>
<li>1&le; N&le; 10^3</li>
<li>1&le; A<sub>i</sub>&le; 10^9</li>
</ol>

<p>Sample <strong>input/output</strong>:</p>

<p>array <code>4 8 2 3</code>
output is <code>3</code></p>

<p><strong>Explanation:</strong></p>

<p>answer set is (4,8,2)</p>

<p>size of the set is 3</p>