## Number of ways to select a node from each connected component

Given a graph with N nodes and M edges. The task is to find the number of ways to select a node from each connected… Read More »

- How can one become good at Data structures and Algorithms easily?
- Understanding The Coin Change Problem With Dynamic Programming
- Subset array sum by generating all the subsets
- Make all numbers of an array equal
- Reach the numbers by making jumps of two given lengths
- Some useful C++ tricks for beginners in Competitive Programming
- Check if a number is perfect square without finding square root
- Sum of XOR of all subarrays
- Sum of the first N Prime numbers
- Sort the array of strings according to alphabetical order defined by another string
- Sum of similarities of string with all of its suffixes
- Length of the longest Subarray with only Even Elements
- Check if it is possible to reach a number by making jumps of two given length
- Find the number in a range having maximum product of the digits
- Make Binary Search Tree
- Print matrix in snake pattern from the last column
- Maximum of all Subarrays of size k using set in C++ STL
- Smallest Pair Sum in an array
- Number of array elements derivable from D after performing certain operations
- Count distinct substrings that contain some characters at most k times
- Minimum number of sets with numbers less than Y
- Count the number of vowels occurring in all the substrings of given string
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Operations required to make the string empty
- Find two numbers whose divisors are given in a random order
- Sum of the multiples of two numbers below N
- Number of subarrays have bitwise OR >= K
- Remove characters from a numeric string such that string becomes divisible by 8
- Program to find the kth character after decrypting a string
- Maximum length substring with highest frequency in a string

Given a graph with N nodes and M edges. The task is to find the number of ways to select a node from each connected… Read More »

Given C magnets and an array arr[] representing N index positions where C ≤ N. The task is to place these magnets at these available… Read More »

Given an array arr[] consisting of N positive integers, and some queries consisting of a range [L, R], the task is to find whether the… Read More »

Given n 2-D points points[], the task is to find the perimeter of the convex hull for the set of points. A convex hull for… Read More »

Given an array arr[] of integers and an array q[] of queries. For the ith query, index = q[i][0] and value = q[i][1]. The task… Read More »

Given a 2-D matrix mat[][] the task is count the number of connected components in the matrix. A connected component is formed by all equal… Read More »

Given a range [L, R]. The task is to count the numbers in the range having difference between the sum of digits at even position… Read More »

Given a NxN matrix, the task is to find the sum of bit-wise AND of all of its rectangular sub-matrices. Examples: Input : arr[][] =… Read More »

Given two positive integers B and N. The task is to find the number of trailing zeroes in b-ary (base B) representation of N! (factorial… Read More »

Given an integer x and an array arr[] each element of which is a power of 2. The task is to find the minimum number… Read More »

Given a grid N x M size and initial position (X, Y) and a series of K moves. Each move contains 2 integers Dx and… Read More »

Given a set of points, the task is to find the covex hull of the given points. The convex hull is the smallest convex polygon… Read More »

Given an array A[], the task is to find the minimum number of operations required to convert the array into B[] such that for every… Read More »

Given an array arr[] containing N integers and two integers X and Y. Consider N line segments, where each line segment has starting and ending… Read More »

Given an integer n, the task is to count Dyck words possible of length n. A DYCK word is a word containing only characters ‘X’… Read More »