# Category Archives: Competitive Programming

## Find triplets in an array whose AND is maximum

Given an array of positive integers of size n. Find the count of the triplets whose AND is maximum and also find that maximum given… Read More »

## Minimum number of increasing subsequences

Given an array of integers of size N, you have to divide it into the minimum number of “strictly increasing subsequences” For example: let the… Read More »

## Kth Smallest sum of continuous subarrays of positive numbers

Given an sorted array of positive numbers our tasks is to find the kth smallest sum of continuous subarray. Examples: Input : a[] = {1,… Read More »

## Check if any square (with one colored cell) can be divided into two equal parts

Given a square of size n . There are n2 small squares inside the square n of size 1 unit each, in which any one… Read More »

## Find the count of maximum contiguous Even numbers

Given an array arr[] of N elements. The task is to find the maximum number of the contiguous even numbers in the given array. Examples:… Read More »

## Length of largest sub-array having primes strictly greater than non-primes

Given an array ‘arr’ of length ‘n’. The task is to find the largest contiguous sub-array having the count of prime numbers strictly greater than… Read More »

## Minimum cost to buy N kilograms of sweet for M persons

Given an array of n size contains the cost of sweets in such a way that that sweet[i] is the cost of i sweets. The… Read More »

## Number of steps required to convert a binary number to one

Given a binary string str, the task is to print the numbers of steps required to convert it to one by the following operations: If… Read More »

## Check if elements of an array can be arranged in a Circle with consecutive difference as 1

Given an array of numbers. The task is to check if it is possible to arrange all the numbers in a circle so that any… Read More »

## Find the missing value from the given equation a + b = c

Given an equation of the form: a + b = c Out of which any one of the terms , or is missing. The task… Read More »

## Find four factors of N with maximum product and sum equal to N | Set 3

Given an integer N. The task is to find all factors of N and print the product of four factors of N such that: Sum… Read More »

## Check if the given 2-D points form T-shape or not

Given the coordinates of 5 2-dimensional points, check if they form a closed T shape. Print ‘Yes’ if they form T shape and ‘No’ otherwise.… Read More »

## Minimum changes required to make two arrays identical

Given two arrays and with n elements each. The task is to make these two arrays identical i:e, for each , we want to make… Read More »

## Maximize the product of four factors of a Number

Given an integer N, the task is to find the maximum product of A, B, C, D such that below conditions satisfy: N%A ==0 &&… Read More »

## Find Nth term (A matrix exponentiation example)

We are given a recursive function that describes Nth terms in form of other terms. In this article we have taken specific example. Now you… Read More »