Given a vector vec, and a integer K the task is to count the number of elements such that it occurs only once in the vector and with the number Kth times Read more →
Data Structures
5 postsGiven two arrays a and b of the same size. Find the count of total pair in array a, such that the sum of elements of pair of array a is greater Read more →
Given a string S containing 0’s and 1’s, the task is to find the length of longest continuous substring of 0’s from the given string. Examples: Input: S = 1111111 Output: 0 Read more →
Given an array consisting of integers in range 1 to n consisting of only one duplicate element. Find out the duplicate element in O(logN) time. Examples: Input : 6 1 1 2 Read more →
Given n strings in any order. Sort all the strings (lexicographically), but if a string is present completely as a prefix in another string, then string with larger length should come first. Read more →
Given a zero-indexed array P containing N integers (a permutation of number from 1 to N), where P[i] denotes the number of the rose which will start blooming on day number i+1, Read more →
Given an array arr[] of N points. The task is to sort these points according to it’s distance from the origin. Examples: Input: arr[] = { {5,0}, {4,0}, {3,0}, {2,0}, {1,0} } Read more →
Given 2 strings A and B, the task is to count the number of substrings of A which are also present in B. Example: Input: a="plu" b="Cplusplus" Output: 6 Explanation: p, l, Read more →
Given an array arr, the task is to find the sum of the elements which have composite frequencies in the array. Examples: Input: arr[] = {5, 4, 6, 5, 4, 6} Output: Read more →
Given an array arr, the task is to find the product of the elements which have composite frequencies in the array. Examples: Input: arr[] = {4, 6, 5, 4, 6} Output: 5 Read more →