# Category Archives: Competitive Programming

## Count of elements which is product of a pair or an element square

Given an array arr[] of N positive integers, the task is to count the number of array elements which can be expressed as the product… Read More »

## Maximum points of intersections possible among X circles and Y straight lines

Given two integers X and Y, the task is to find the maximum number of points of intersection possible among X circles and Y straight… Read More »

## Check if Array elements can be maximized upto M by adding all elements from another array

Given a positive integer M and two arrays arr[] and value[] of N and K positive integers respectively, the task is to add every element… Read More »

## Count of paths in given Binary Tree with odd bitwise AND for Q queries

Given an integer Q representing the number of queries and an array where each query has an integer N. Our task is to iterate through… Read More »

## Count of Array elements to be divided by 2 to make at least K elements equal

Given an integer array arr[] of size N, the task is to find the minimum number of array elements required to be divided by 2,… Read More »

## Maximum sum by picking elements from two arrays in order | Set 2

Given two arrays A[] and B[], each of size N, and two integers X and Y denoting the maximum number of elements that can be… Read More »

## Bitonic string

Given a string str, the task is to check if that string is a Bitonic String or not. If string str is Bitonic String then… Read More »

## Find initial sequence that produces a given Array by cyclic increments upto index P

Given an array arr[] consisting of N elements and an integer P, the task is to find the initial array from which given arr[] is… Read More »

## Count sequences of length K having each term divisible by its preceding term

Given two integer N and K, the task is to find the number of sequence of length K consisting of values from the range [1,… Read More »

## Check given string is oddly palindrome or not | Set 2

Given string str, the task is to check if characters at the odd indexes of str form a palindrome string or not. If not then… Read More »

## Maximize count of corresponding same elements in given permutations using cyclic rotations

Given two permutations P1 and P2 of numbers from 1 to N, the task is to find the maximum count of corresponding same elements in… Read More »

## Array sum after replacing all occurrences of X by Y for Q queries

Given an integer array arr[] and Q queries, the task is to find the sum of the array for each query of the following type:… Read More »

## Largest interval in an Array that contains the given element X for Q queries

Given an array arr[] of N elements and Q queries of the form [X]. For each query, the task is to find the largest interval… Read More »

## Minimum changes required to make all Array elements Prime

Given an array of integers arr[], the task is to count the minimum number of changes required to convert each array element to its nearest… Read More »

## Count all prime numbers in a given range whose sum of digits is also prime

Given two integers L and R, the task is to find the count of total numbers of prime numbers in the range [L, R] whose… Read More »