# Category Archives: Competitive Programming

## 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 »

## Level order traversal in spiral form using stack and multimap

Given a binary tree of N nodes, the task is to print level order traversal in a spiral form. In spiral form, nodes at the… Read More »

## Count of ways to distribute N items among 3 people with one person receiving maximum

Given an integer N, the task is to find the total number of ways to distribute N among 3 people such that: Exactly one person… Read More »

## Change in Median of given array after deleting given elements

Given two arrays arr1[] and arr2[]. The array arr1[] is sorted. The task is to print the change in median after removing each element from… Read More »