Skip to content

Tag Archives: sliding-window

Given an integer N and a value K, the task is to find the number of factors of length K that are present in the… Read More
Given an array of positive elements arr[] of length N, the task is to count all the subarrays such that the product of the subarray… Read More
Given a positive integer array arr[] of size N, the task is to find the longest subarray such that the bitwise AND of every pair… Read More
Given a string S of length N, the task is to find two non-intersecting strings of equal length such that the sum of absolute differences… Read More
You are given an array A[] of size N, the task is to divide the array into exactly three subarrays such that every element belongs… Read More
Given N elements that have two costs associated with them that are represented in two arrays Costs1[] and Costs2[] of length N each and an… Read More
Given an array arr[] of length N consisting of positive integers and an integer X, the task is to find the maximum number of adjacent… Read More
Given a binary array a[] or size N and an integer K, the task is to find the longest subarray consisting of only 1s or… Read More
Given an array A[] of length N and two integers X and K, The task is to count the number of indices i (0 ≤… Read More
Given a string S of size N consisting of the characters 0, 1 and 2, the task is to find the length of the smallest… Read More
Given a binary sequence of 1‘s and 0‘s. Our task is to remove all 1s from the sequence in minimum cost by below operations. Remove… Read More
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] and its permutations (or… Read More
Given a binary string str of length N, the task is to find the number of setbits in the bitwise OR of all the K… Read More
Given a binary circular array arr[] of size N, the task is to find the minimum swaps to group all 0s together in the array.… Read More
Given two arrays X[] and Y[] of size N, the task is to find the longest subarray in X[] containing only unique values such that… Read More

Start Your Coding Journey Now!