Say I have array
{0, 1, 2, 3, 4}
Or
{0, 1, 2, 3, 4, 5}
I remember seeing a really clever way to do this. Something like
i%array.length
Try this one:
oppIndex = array.length - firstIndex - 1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With