Find first and last position of element in sorted array

problem [https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/ 34. Find First and Last Position of Element in Sorted Array].

Problem description
Given an array of integers  sorted in ascending order, find the starting and ending position of a given   value.

If  is not found in the array, return.

Follow up: Could you write an algorithm with  runtime complexity?

Input: nums = [5,7,7,8,8,10], target = 8 Output: [3,4] Input: nums = [5,7,7,8,8,10], target = 6 Output: [-1,-1] Input: nums = [], target = 0 Output: [-1,-1]
 * Example 1
 * Example 2
 * Example 3:


 * Constraints:'''
 * is a non-decreasing array.
 * is a non-decreasing array.
 * is a non-decreasing array.

Subproblems to solve

 * First target in sorted array
 * Last target in sorted array