Replace every element with the smallest element on its left side
Given an array of integers, the task is to replace every element with the smallest element on its left side. Note: Replace the first element with -1 as it has no element in its left. Examples: Input: arr[] = {4, 5, 2, 1, 7, 6} Output: -1 4 4 2 1 1 Since, 4 has no element in its left, so replace it b