Given two integers N and M representing the Length of arr[] and number of seconds. The task is to maximize the sum of the subarray… Read More
Tag Archives: sliding-window
Given a linked list of integers and a number K, find the maximum product of a sublist of length K in a linked list. Examples:… Read More
Given two linked lists head1 and head2, the task is to find occurrences of head2 in head1. Examples: Input: Head1 = 1->2->3->2->4->5->2->4, Head2 = 2->4Output:… Read More
Given an array, arr[], and an integer K, the task is to check whether K consecutive palindrome numbers are present or not. Examples: Input: arr[]… Read More
Given an array arr[] containing N elements, the task is to find the length of the longest subarray of an input array containing at most… Read More
Given a linked list of characters and a string S. Return all the anagrams of the string present in the given linked list. In case… Read More
Given an array arr[] of size N, the array represents N / 2 coordinates of a rectangle randomly shuffled with its X and Y coordinates.… Read More
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 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