Print greater elements present on the left side of each array element
Given an array arr[] consisting of N distinct integers, the task is to print for each array element, all the greater elements present on its left. Examples: Input: arr[] = {5, 3, 9, 0, 16, 12}Output:5: 3: 59: 0: 9 5 316: 12: 16 Input: arr[] = {1, 2, 0}Output:1: 2: 0: 2 1 Naive Approach: The simplest