## Length of longest subarray of length at least 2 with maximum GCD

Given an array arr[] of length N, the task is the find the length of longest subarray of length at least 2 with maximum possible… 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 length N, the task is the find the length of longest subarray of length at least 2 with maximum possible… Read More »

Given an even number N, the task is to split all N powers of 2 into two sets such that the difference of their sum… Read More »

Given an integer array A[] of length N and an integer K. The task is to find K distinct integral points which are not present… Read More »

Given an array arr[] of length N, the task is to minimize the count of the number of non-zero elements by adding the value of… Read More »

Given an integer N, the task is to count the number of N digit palindromic numbers containing digits from 1 to 9 and divisible by… Read More »

Given an integer array arr[] of size N, the task is to count the number of sub-arrays that have an odd product. Examples: Input :… Read More »

Given an array arr[] of size N which contains the marks of a student in N subjects, the task is to calculate the CGPA and… Read More »

Given an array arr[] and integer K, the task is to find the minimum bitwise XOR sum of any subarray of size K in the… Read More »

Given an array arr[], the task is to find the largest number that can be formed from a pair in the given array. Examples: Input:… Read More »

Given weights and profits of N items, put these items in a knapsack of capacity W. The task is to print all possible solutions to… Read More »

Given an array arr[] of N co-ordinate points, the task is to check wheather a straight line can be formed using these co-ordinate points. Input:… Read More »

Given an integer N which denotes the number of divisors of any number, the task is to find the maximum prime divisors that are possible… Read More »

Given two numbers A and B, the task is to check that A and B are in golden ratio. Golden Ratio: Two numbers are said… Read More »

Given two numbers, N and M, the task is to find two numbers made up of M as all its digits such that their difference… Read More »

Given two arrays A[] and B[] both having N elements. Find the minimum number of operations to make all elements of A equal to the… Read More »