# Category Archives: Competitive Programming

## Find the largest composite number that divides N but is strictly lesser than N

Given a composite number N, the task is to find the largest composite number that divides N and is strictly lesser than N. If there… Read More »

## Counting Inversions using Ordered Set and GNU C++ PBDS

Given an array arr[] of N integers. The task is to find the number of inversion. Two elements arr[i] and arr[j] form an inversion if… Read More »

## Check if the given string is shuffled substring of another string

Given strings str1 and str2. The task is to find that if str1 is substring in shuffled form of str2 or not. Print “YES” if… Read More »

## How To Approach A Coding Problem ?

Developers and students solve a lot of coding questions of data structures and algorithms but most of them don’t understand the importance of it. A… Read More »

## Why You Should Become a Self-Taught Programmer?

You may have heard about Jack Dorsey (Twitter), Mark Zuckerberg (Facebook), Kevin Systrom (Instagram) and many others. Right, these are one of the top programmers… Read More »

## 7 Best Coding Challenge Websites in 2020

Every coder wants to be one of the best! Yes, it’s true. But do you ever think how can someone be considered as the best… Read More »

## Length of longest Subarray with equal number of odd and even elements

Given an integer array arr[], the task is to find the length of the longest subarray with an equal number of odd and even elements.… Read More »

## Speed up Code executions with help of Pragma in C/C++

The primary goal of a compiler is to reduce the cost of compilation and to make debugging produce the expected results. Not all optimizations are… Read More »

## Find minimum number of steps to reach the end of String

Given a binary string str of length N and an integer K, the task is to find the minimum number of steps required to move… Read More »

## Count possible combinations of pairs with adjacent elements from first N numbers

Given a number N, the task is to count all possible combinations of pairs formed using adjacent elements. Note: If an element exists already in… Read More »

## Count of Subsets of a given Set with element X present in it

Given an array arr[] of N unique positive integers and an element X, the tasks is to count the total possible number of subsets of… Read More »

## Find two equal subsequences of maximum length with at least one different index

Given a string str, the task is to find the maximum length K such that there exist two sub-sequences A and B each of length… Read More »

## Check if a number has prime count of divisors

Given an integer N, the task is to check if the count of divisors of N is prime or not. Examples: Input: N = 13… Read More »

## Find distinct integers for a triplet with given product

Given an integer X, the task is to find the three distinct integers greater than 1 i.e. A, B and C such that (A *… Read More »

## Maximum profit by selling N items at two markets

Given two array A[] and B[] each of length N where A[i] and B[i] are the prices of the ith item when sold in market… Read More »