...an array containing N elements and each element can either be 0 or 1 or 2 and in the question its mentioned that they want the best case time complexity, so can we assume that all the elements are 0’s or all the elements are 1’s or all elements are 2’s if soo then simply apply Insertion sort.
because in best case insetion sort takes o(n) time complexity because we just need to do n comparisons and no need of shift operation .