I’ve got a sequence of numbers – 1,2,3,4,5,....100
The sequence is divided by groups and every one has 3 numbers in it (except the last one) – [1,2,3] [4,5,6] ... [97,98,99] [100]
I’m trying to find the index of a group for a specific number.
For example:
- Number 1 will have group index 0
- Number 4 will have group index 1
- Number 6 will have group index 1
What’s the fastest way to find that group index, besides looping through all groups?
Thank you.
What you need is: