Say you have an array of size n, which is composed of x groups of items of size y. For example, an array of size 12, composed of 3 groups of 4 items.
x*y = n
Given an index (i) of an item, how would you determine which group (g) it is in?
For example in the array above, you’re given an index of 6 (where index starts at 0). That means it’s the 3rd item in the 2nd group, so g = 2. An index of 8 would yield g = 3, because it's the first item in the 3rd group.
What’s the formula for deriving this result (g)?