Given a sorted array `nums` and a `target`, return the first and last index of target as [first, last]. If target is absent, return [-1, -1]. Run in O(log n).