Tag Archives: subsequence

Queries on subsequence of string

Given a string S and Q queries, each query contains a string T. The task is print “Yes” if T is subsequence of S, else print “No”. Examples: Input : S = “geeksforgeeks” Query 1: “gg” Query 2: “gro” Query 3: “gfg” Query 4: “orf” Output : Yes No Yes No For each query, using… Read More »

Maximum sum Bi-tonic Sub-sequence

Given an array of integers. A subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Examples: Input : arr[] = {1, 15, 51, 45, 33, 100, 12, 18, 9} Output : 194 Explanation : Bi-tonic Sub-sequence are : {1, 51, 9} or {1, 50, 100, 18, 9} or {1, 15, 51,… Read More »