Skip to content

Tag Archives: deque

Given a sorted array arr[] of the first N Natural Numbers and an integer X, the task is to print the last remaining element after… Read More
Given two sentences S1 and S2, the task is to check if the sentences can be made equal by inserting at most one sentence(possibly, empty)… Read More
Given an array arr[] consisting of N positive integers and a string S of length (N – 1), containing characters ‘+’ and ‘*’, the task… Read More
Given a string S consisting of N characters, the task is to find the length of all prefixes of the given string S that are… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to print the maximum sum possible in a subsequence satisfying… Read More
Queue: A Queue is a linear data structure that follows a First In First Out (FIFO) order in which the operations are performed. It is… Read More
Given integers N, L and R, the task is to generate a Bitonic Sequence of length N from the integers in the range [L, R]… Read More
Given a Linked List of even number of nodes, the task is to generate a new Linked List such that it contains the maximum difference… Read More
Given two positive integers N and K and an array F[] consisting of K positive integers. The Nth term of the recurrence relation is given… Read More
Deque is a Double Ended Queue which is implemented using the collections module in Python. Let us see how can we get the first and… Read More
Given a string str, the task is to find the substring of length K which occurs the maximum number of times. If more than one… Read More
Given an array A[] consisting of N integers and an integer K, the task is to maximize the length of the subarray having equal elements… Read More
Given an array arr[] of size N and queries Q[][], the task is to perform the following types of queries on the given array. 0:… Read More
Given string str of length N and an integer K, the task is to return the largest string in Dictionary Order by erasing K characters… Read More
Given a non-decreasing array arr[] and an integer K, the task is to remove K elements from the array such that maximum difference between adjacent… Read More