Find index of first occurrence when an unsorted array is sorted
Given an unsorted array and a number x, find an index of first occurrence of x when we sort the array. If x is not present, print -1. Examples: Input : arr[] = {10, 30, 20, 50, 20} x = 20 Output : 1 Sorted array is {10, 20, 20, 30, 50} Input : arr[] = {10, 30, 20, 50, 20} x = 60 Output : -1 60 is no