You are given a sorted array that has been rotated at an unknown pivot and may contain duplicates. Given a target value, return the first and last position of that target in the array. If not found, return -1 -1.
This simulates searching in partially corrupted or shifted datasets.