Converting loosely typed recursive function to strongly typed
<p>With list as a global array and size as a global int, how would I write this function in Java or C#?</p>

<pre><code>function getId(index) {
if (index &lt; size) {
    return list[index];
}
return getId((index / size) - 1) + getId(index % size);
}
</code></pre>
