Skip to content

Tag Archives: Suffix-Array

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<kExamples:   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 : str… 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
We strongly recommend to read following post on suffix trees as a pre-requisite for this post.Pattern Searching | Set 8 (Suffix Tree Introduction)A suffix array… Read More