# Category Archives: Competitive Programming

## Minimum number of operations required to sum to binary string S

Given a binary string S. Find the minimum number of operations required to be performed on the number zero to convert it to the number… Read More »

## Count of Numbers in Range where first digit is equal to last digit of the number

Given a range represented by two positive integers L and R. Find the count of numbers in the range where the first digit is equal… Read More »

## Form N-copy string with add, remove and append operations

A string is called a N-copy string when it is formed by N copies of letter ‘G’. ie “GGGG” is a 4-copy string since it… Read More »

## Minimum in an array which is first decreasing then increasing

Given an array of N integers where array elements form a strictly decreasing and increasing sequence. The task is to find the smallest number in… Read More »

## Sort the array of strings according to alphabetical order defined by another string

Given a string str and an array of strings strArr[], the task is to sort the array according to the alphabetical order defined by str.… Read More »

## LCM of N numbers modulo M

Given an array arr[] of integers, the task is to find the LCM of all the elements of the array modulo M where M =… Read More »

## Count numbers in a range having GCD of powers of prime factors equal to 1

Given a range represented by two positive integers L and R. The task is to count the numbers from the range having GCD of powers… Read More »

## Print matrix in snake pattern from the last column

Given a matrix of 2-Dimensional array of n rows and n columns. Print this matrix in snake fashion starting from column n-1 as shown in… Read More »

## Print matrix in zig-zag fashion from the last column

Given a matrix of 2-Dimensional array of n rows and n columns. Print this matrix in ZIG-ZAG fashion starting from column n-1 as shown in… Read More »

## Sum of the multiples of two numbers below N

Given three integer A, B and N. The task is to find the sum of all the elements below N which are multiples of either… Read More »

## How can one become good at Data structures and Algorithms easily?

Designed by Freepik Let us first clarify the question. There is not any easy way to become good at anything but there is an efficient… Read More »

## Maximum sum by picking elements from two arrays in order

Given two arrays of size N and two integers X and Y indicating the maximum number of elements one can pick from array A and… Read More »

## Find the Number of Maximum Product Quadruples

Given an array of N positive elements find the number of quadruple, (i, j, k, m) such that i < j < k < m… Read More »

## Reduce the array to a single element with the given operation

Given an integer N and an array arr containing integers from 1 to N in sorted fashion. The task is to reduce the array to… Read More »

## Maximum sum of all elements of array after performing given operations

Given an array of integers. The task is to find the maximum sum of all the elements of the array after performing the given two… Read More »