Print greater elements present on the left side of each array elementGiven 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: 16Input: arr[] = {1, 2, 0}Output:1: 2: 0: […]

Continue ReadingFind index of an element in a Set in C++Given a set S consisting of N integers and an element K, the task is to find the index of the element K in the set S. If the element is not present in S, print -1.Examples:Input: N = 5, S = {1, 2, 3, 4, […]

Continue ReadingMinimum subsequences of a string A required to be appended to obtain the string B Given two strings A and B, the task is to count the minimum number of operations required to construct the string B by following operations: Select a subsequence of the string A. Append the subsequence at the newly formed string […]

Continue Reading