##
Sum of product of all elements of sub-arrays of size k
July 3, 2017

Given an array and a number k, the task is to calculate the sum of the product of all elements of subarrays of size k.… Read More »

July 3, 2017

Given an array and a number k, the task is to calculate the sum of the product of all elements of subarrays of size k.… Read More »

June 21, 2017

Given an array of n integers. Count total number of sub-array having total distinct elements same as that of total distinct elements of original array.… Read More »

June 8, 2017

Given an array and a positive integer k, find the first negative integer for each and every window(contiguous subarray) of size k. If a window… Read More »

June 6, 2017

Given an array, find the subarray (containing at least k numbers) which has the largest sum. Examples: Input : arr[] = {-4, -2, 1, -3}… Read More »

May 23, 2017

Given a string, find the smallest window length with all distinct characters of the given string. For eg. str = “aabcbcdbca”, then the result would… Read More »

April 16, 2017

This technique shows how a nested for loop in few problems can be converted to single for loop and hence reducing the time complexity. Let’s… Read More »

March 15, 2017

Given an array of integers and a number k, find maximum sum of a subarray of size k. Examples : Input : arr[] = {100,… Read More »

January 4, 2017

Given an array of both positive and negative integers, the task is to compute sum of minimum and maximum elements of all sub-array of size… Read More »

September 10, 2015

Given an integer array of size n, find the maximum of the minimum’s of every window size in the array. Note that window size varies… Read More »

August 6, 2015

Given an array of size n and an integer k, return the of count of distinct numbers in all windows of size k.

May 13, 2014

Given an array of integers and a number x, find the smallest subarray with sum greater than the given value.

May 27, 2011

Given an array and an integer k, find the maximum for each and every contiguous subarray of size k.

March 9, 2011

Given two strings string1 and string2, find the smallest substring in string1 containing all characters of string2 efficiently. For Example: Input : string = “this… Read More »