2 options came to mind:
1. scan the entire array. Check each element is greater than smin and less than smax. Add element to secondary array / list / vector.
2. sort the array. Perform binary search to find the first index location occurrence of smin. Do the same for smax. Return the index locations.
You might want to create 2 binary search methods:
findFirstOccurrence(int x, int[] arr)
findLastOccurrence(int x, int[] arr)