## Count of subarrays of size K which is a permutation of numbers from 1 to K

Given an array arr of distinct integers, the task is to find count of sub-arrays of size i having all elements from 1 to i,… 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
- 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
- Logarithm tricks for Competitive Programming
- Program to calculate Electricity Bill
- Longest sub-array with maximum GCD
- Count of subarrays which start and end with the same element
- Puzzle | Dividing a Square into N smaller squares
- Minimize the maximum difference of adjacent elements after at most K insertions
- Maximum GCD of all subarrays of length at least 2
- Find K distinct positive odd integers with sum N
- Maximum profit by buying and selling a share at most K times | Greedy Approach
- Longest Mountain Subarray
- Expected Number of Trials to get N Consecutive Heads
- Digital Root of a given large integer using Recursion
- Count number of pairs with positive sum in an array
- Program to calculate Percentile of a student based on rank
- Find the minimum number to be added to N to make it a prime number
- Probability of getting K heads in N coin tosses
- Find the K closest points to origin using Priority Queue
- Minimum window size containing atleast P primes in every window of given range

Given an array arr of distinct integers, the task is to find count of sub-arrays of size i having all elements from 1 to i,… Read More »

Given a number N, our task is to print those permutations of integer N which are greater than N. Examples: Input: N = 534 Output:… Read More »

Given three integers N, K and X, the task is to construct an array of length N, in which XOR of all elements of each… Read More »

Given a list of n points on 2D plane, the task is to find the K (k < n) closest points to the origin O(0,… Read More »

Given a numeric string N and an integer K, the task is to split digits of N into subparts such that the number of segments… Read More »

Given an array arr[] containing N elements, the task is to count the number of sub-arrays whose XOR of all the elements is equal to… Read More »

Given an array A[] of N elements consisting of values from 1 to N with duplicates, the task is to find the total number of… Read More »

Given coordinates of three points A(x1, y1, z1), B(x2, y2, z2) and C(x3, y3, z3) in a 3D plane, where B is the intersection point… Read More »

Given an array arr of size N elements, the task is to count the number of pairs of elements in the array whose sum is… Read More »

Given an even number N which represents the number of sides of a regular polygon with N vertices, the task is to find the square… Read More »

Given an array arr of length N and an integer K, the task is to count the number of possible subsequences of length at most… Read More »

Given the size of array N, the task is to construct an array of size N with positive integer elements such that the cube sum… Read More »

Given a numeric string str, the task is to find the smallest integer that can be formed by swapping adjacent digits of distinct parity. Examples:… Read More »

Given two numnbers A and B, the task is to perform BCD Addition of the given numbers. Examples: Input: A = 12, B = 20… Read More »

Given a polynomial string str, the task is to integrate the given string and print the string after integrating it. Note: The input format is… Read More »