## Count of all subsequences having adjacent elements with different parity

Given an array arr[] of size N, the task is to find the number of non-empty subsequences from the given array such that no two… Read More »

- Must do Math for Competitive Programming
- Product of all Subarrays of an Array
- Perfect Sum Problem
- How is the time complexity of Sieve of Eratosthenes is n*log(log(n))?
- Pi(π) in C++ with Examples
- Check whether a number can be represented as difference of two squares
- Modulo Operator (%) in C/C++ with Examples
- Count of subsets with sum equal to X using Recursion
- Program to calculate Electricity Bill
- Logarithm tricks for Competitive Programming
- Maximum number of unique values in the array after performing given operations
- Count of subarrays having exactly K perfect square numbers
- Sum of GCD of all possible sequences
- Find the numbers from 1 to N that contains exactly k non-zero digits
- Find the K closest points to origin using Priority Queue
- Minimize the maximum difference of adjacent elements after at most K insertions
- Minimum number of operations to convert array A to array B by adding an integer into a subarray
- Count of subarrays which start and end with the same element
- Puzzle | Dividing a Square into N smaller squares
- Expected Number of Trials to get N Consecutive Heads
- Maximum GCD of all subarrays of length at least 2
- Maximum profit by buying and selling a share at most K times | Greedy Approach
- Find K distinct positive odd integers with sum N
- Longest Mountain Subarray
- Digital Root of a given large integer using Recursion
- 0/1 Knapsack Problem to print all possible solutions
- Count number of pairs with positive sum in an array
- Check if a given number is a Perfect square using Binary Search
- Probability of getting K heads in N coin tosses
- Count number of binary strings without consecutive 1’s : Set 2

Given an array arr[] of size N, the task is to find the number of non-empty subsequences from the given array such that no two… Read More »

Given a matrix of size N x M and an integer X, the task is to find the number of sub-squares in the matrix with… Read More »

Given an array arr[] of size N, the task is to rearrange the array elements such that for every index i(1 <= i <= N… Read More »

Given a number N, the task is to find the sum of Hamming difference of consecutive numbers from 0 to N. Hamming Distance between two… Read More »

Given an integer N, the task is to find its perfect square root by repeated subtraction only. Examples: Input: N = 25 Output: 5 Input:… Read More »

Given three positive integers N, A, and B, the task is to check if it is possible to obtain N by adding or subtracting A… Read More »

Given an array A[] of size N, the task is to maximize the count of distinct elements in the array by inserting the absolute differences… Read More »

Given two integers A and B, the task is to print the integer among the two, which will be converted to an odd integer by… Read More »

Given four integers A, N, L and R, the task is to find the N th number in a sequence of consecutive integers from L… Read More »

Given an integer K and an array A[ ] whose length is multiple of K, the task is to split the elements of the given… Read More »

Given two integers N and M, the task is to find the numbers of ways to form a matrix of size N * M consisting… Read More »

Given two numbers N and K, the task is to find the minimum value X such that N < X*K. Examples: Input: N = 8,… Read More »

Given two integers N and K, the task is to find the count of N-digit numbers such that the absolute difference of adjacent digits in… Read More »

Given an array arr[] having N integers and an integer K, the task is to select K elements from the given array such that sum… Read More »

Given two array of N integers arr[] and costArray[], representing removal cost associated with each element. The task is to find the subsequence from the… Read More »