## Minimum number of increment/decrement operations such that array contains all elements from 1 to N

Given an array of N elements, the task is to convert it into a permutation (Each number from 1 to N occurs exactly once) by… Read More »

- Practice for cracking any coding interview
- How to get rid of Java TLE problem
- How can one become good at Data structures and Algorithms easily?
- Burst Balloon to maximize coins
- Understanding The Coin Change Problem With Dynamic Programming
- Subset array sum by generating all the subsets
- Reach the numbers by making jumps of two given lengths
- Sum of similarities of string with all of its suffixes
- Make all numbers of an array equal
- Maximize the total profit of all the persons
- Find triplets in an array whose AND is maximum
- Some useful C++ tricks for beginners in Competitive Programming
- Length of the longest Subarray with only Even Elements
- Check if a number is perfect square without finding square root
- Print matrix in snake pattern from the last column
- Sort the array of strings according to alphabetical order defined by another string
- Python in Competitive Programming
- Sum of the first N Prime numbers
- How to read Competitive Programming Questions?
- How can competitive programming help you get a job?
- Check if it is possible to reach a number by making jumps of two given length
- Minimum changes required to make two arrays identical
- Number of array elements derivable from D after performing certain operations
- C++: Methods of code shortening in competitive programming
- Sum of the multiples of two numbers below N
- Number of quadrilaterals possible from the given points
- Minimum number of increasing subsequences
- Find two numbers whose divisors are given in a random order
- Minimum number of sets with numbers less than Y
- Smallest Pair Sum in an array

Given an array of N elements, the task is to convert it into a permutation (Each number from 1 to N occurs exactly once) by… Read More »

Given a string ( containing characters from ‘0’ to ‘9’) and two digits and . The task is to find the substring in the given… Read More »

Given two integers N and M, partiton N into M integers such that the difference between the maximum and minimum integer obtained by the partition… Read More »

Given four integers sourceX, sourceY, destinationX and destinationY which represent the source and destination coordinates on a chessboard. The task is to find the minimum… Read More »

Given an array of distinct elements, the task is to find the total number of two element pairs from the array whose sum is a… Read More »

Given an even number N. The task is to consider numbers from 1 to N2, split them into N groups of the equal sum. Examples:… Read More »

Given a string str containing only lowercase English alphabets, the task is to find the sum and product of all the prime frequencies of the… Read More »

Given two integers and and an array arr[] every element of which at index is calculated as arr[i] = i * (-1)i. The task is… Read More »

Given an N-ary tree, print the number of leaf nodes in the subtree of every node. Examples: Input: 1 / \ 2 3 / |… Read More »

Given an array of integers. The task is to sort the given array on the basis increasing count of distinct prime factors. Examples: Input :… Read More »

Given integers i, j, k and n where (i, j) is the initial position of the Knight on a n * n chessboard, the task… Read More »

Given two binary numbers strings and of length . Find the number of ways of swapping two bits in s1(only s1 not s2) so that… Read More »

Given that the three players playing a game of rolling a dice. Player1 rolled a dice got A and player2 rolled a dice got B.… Read More »

Given a very large number in the form of a string, the task is to check if the number is divisible by 75 or not.… Read More »

Given an array of N numbers, the task is to print all the numbers greater than 1 which divide the maximum of array elements. Examples:… Read More »