## Replace elements with absolute difference of smallest element on left and largest element on right

Given an array arr[] of N integers. The task is to replace all the elements of the array by the absolute difference of the smallest… Read More »

- Find number of triplets in array such that a[i]>a[j]>a[k] and i<j<k
- Find the farthest smaller number in the right side
- Find the final radiations of each Radiated Stations
- Replace elements with absolute difference of smallest element on left and largest element on right
- Find the longest sub-string which is prefix, suffix and also present inside the string | Set 2

Given an array arr[] of N integers. The task is to replace all the elements of the array by the absolute difference of the smallest… Read More »

Given string str. The task is to find the longest sub-string which is a prefix, a suffix and a sub-string of the given string, str.… Read More »

Given an array arr[] of size N. For every element in the array, the task is to find the index of the farthest element in… Read More »

Given an array arr of size N. The task is to count number of triplets in the array such that a[i]>a[j]>a[k] and i<j<k Examples: Input… Read More »

There are N stations in a straight line, each of them has some non-negative radiation power. Every station can increase the radiation power of its… Read More »

Given an array arr[] of integers and an integer K, the task is to find the maximum sum taking every Kth element i.e. sum =… Read More »

Given an integer K and an array arr[], the task is to split the array arr[] into K consecutive subarrays to find the maximum possible… Read More »

Given an array of N elements and Q queries, where each query contains an integer K. For each query, the task is to find the… Read More »

Given a bracket sequence of even length. The task is to find how many ways are there to make balanced bracket subsequences from the given… Read More »

Given, an array of size N. Find an element which divides the array into two sub-arrays with equal product. Print -1 if no such partition… Read More »

Pre-requisite: Suffix Array. What are k-mers? The term k-mer typically refers to all the possible substrings of length k that are contained in a string.… Read More »

What is the Burrows-Wheeler Transform? The BWT is a data transformation algorithm that restructures data in such a way that the transformed message is more… Read More »

Given a string of lower alphabetic characters, find K-th character in a string formed by substrings (of given string) when concatenated in sorted form. Examples:… Read More »

Given a string of length n of lowercase alphabet characters, we need to count total number of distinct substrings of this string. Examples: Input :… Read More »

A suffix array is a sorted array of all suffixes of a given string. The definition is similar to Suffix Tree which is compressed trie… Read More »