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 →
Algorithms
6 postsYou are given an array of integers and sum. You have to find out if there exist a pair of sum is equal to that sum or not. Print “Yes” if exist, Read more →
Given an array of N size denotes number of students and element of array denotes marks of students ,marks belongs between 1 to 100, where A[i] is less or equal to 32 Read more →
Given a sorted array and a value x, we need to find floor and ceil value of x in the array using improved binary search technique. Floor value is the largest element 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 a sequence A1,A2,A3,….,An and an empty sequence B. You need to find M minimum number of times this sequence should be appended in B, so that the length of longest increasing 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 →