Given two arrays prices[], type[] and an integer S, the task is to check if two items can be selected from two different categories without… Read More

# Category Archives: Competitive Programming

Given a tree of N nodes, the task is to find the node having maximum depth starting from the root node, taking the root node… Read More

Given string str consisting of only lowercase English alphabets, the task is to find the substring of the smallest length which contains all the vowels.… Read More

Given an array arr[] consisting of N positive numbers and Q queries of the form [L, R], the task is to find the number of… Read More

Given a string str, the task is to find the minimum length of substring required to rotate that generates a palindromic substring from the given… Read More

Given an array arr[] of line segments on the x-axis and an integer K, the task is to calculate the number of ways to choose… Read More

Given two integers L and R, the task to find the number of Double Prime numbers in the range. A number N is called double… Read More

Given string S consisting of only lowercase English letters. The task is to find if there exists any string which has left shift and right… Read More

Given an integer N, the task is to count of decreasing pairs from numbers 1 to N. A pair (x, y) is said to be… Read More

Given two integers N and K, the task is to print the number formed by adding product of its max and min digit, K times.… Read More

Given an array arr[] of size N and an array Q[][] consisting of M queries that needs to be processed on the given array. It… Read More

Given an array A containing N integers, the task is to count the number of elements which form a cycle in the array, based on… Read More

Given two array a[] and b[] of size N, the task is to print the count of operations required to make all the elements of… Read More