Given an integer array a[] of size N and a target sum K, subtract a number from each element such that each element becomes X ( if an element is less than Read more →
Searching
27 postsGiven a statement(string), the task is to check if that string contains any word which contains ‘a’ in it then print that word otherwise print no any word containing ‘a’ in the Read more →
Given an array containing n numbers. The problem is to find the length of the longest zigZag subarray such that every element in the subarray should be in form a < b Read more →
Given a binary tree and two nodes a and b, the task is to print the maximum node value that lies in the path connecting the nodes a and b. If either Read more →
In a prison, there are N cells. The positions of the cells are given in an array. The Jailer has to place all the prisoners in the cells in an ordered manner Read more →
Given an infinite stream of integers, find the k’th largest element at any point of time. It may be assumed that 1 <= k <= n. Example: Input: stream[] = {10, 20, Read more →
You are given two strings string1 and string2. Your task is to find length of longest consecutive occurrences of second string that occurs in first string. Examples: Input: string1="AAACBBAAAA", string2="A" Output: 4 Read more →
Given an array of size N. The task is to find the maximum and the minimum element of the array using the minimum number of comparisons. Examples: Input : A[]={4,2,-1,5,0,-5,7,3,6} Output : Read more →
Given an array A[ ] of N segments find any point common to maximum number of segments and also find the number of segments which it is common to. The segments are Read more →
You have to paint n boards of length {L1, L2, L3,…,Ln-1}. There are k painters available and each painter takes t time to paint 1 unit of board. You have to get Read more →