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 →
Latest tutorials
505 postsGiven 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 →
Given a positive number N denoting the number of People, an array ‘Heights‘ which contains the heights of N persons standing in a queue, and an array ‘Infronts‘ whose each entry gives Read more →
Given numbers from 1 to 10^10, we need to select that maximum number i from the range such that A*b(i)+C*i does not exceed m. A and C will be given and b(i) means Read more →
One combination of made up of N different things. You are given an array of length N which indicate the amount of N different things which one combination contain. You are given Read more →
Given an array arr[] of size N, find the length of its longest subarray such that the sum of its elements not divisible by K, or determine that such subarray does not Read more →
Given two arrays of element between 0 to N- 1 of length N. Find the lexicographically smallest array c such that for any index i c[i] = ( a[i] + b[i])%N. To Read more →
Prerequisite – What is Algorithm | Introduction to Algorithms Advantages of Divide and Conquer Solving difficult problems: Divide and conquer is an efficient method for solving difficult problems. For example, consider the Read more →
Prerequisite – C Language Introduction C comments explain code and improve readability. These do not affect program execution. You can use comments in C to clarify code and describe algorithms. There are two Read more →