## Count of elements which are second smallest among three consecutive elements

Given a permutation P of first N natural numbers. The task is to find the number of elements Pi such that Pi is second smallest… Read More »

- Count Distinct Rectangles in N*N Chessboard
- Maximum number of people that can be killed with strength P
- Sum of all natural numbers from L to R ( for large values of L and R )
- Find the permutation of first N natural numbers such that sum of i % P
_{i}is maximum possible - Partition first N natural number into two sets such that their sum is not coprime
- Find permutation with maximum remainder Sum
- Check if it is possible to redistribute the Array
- Count number of ways to arrange first N numbers
- Divide first N natural numbers into 3 equal sum subsets
- Repeated sum of first N natural numbers
- Difference between Sum of Cubes and Sum of First N Natural Numbers

Given a permutation P of first N natural numbers. The task is to find the number of elements Pi such that Pi is second smallest… Read More »

Given a permutation {P1, P2, P3, ….. PN) of first N natural numbers. The task is to check if it is possible to make the… Read More »

Given a positive integer N > 1, the task is to find the maximum LCM among all the pairs (i, j) such that i <… Read More »

Count number of ways to arrange the first N natural numbers in a line such that the left-most number is always 1 and no two… Read More »

Given a number N. The task is to find the permutation P of first N natural numbers such that sum of i % Pi is… Read More »

Given two integers N and K, the task is to find the sum of first N natural numbers then update N as the previously calculated… Read More »

Given an integer N, find the absolute difference between sum of the cubes of first N natural numbers and the sum of first N natural… Read More »

Given an integer N, the task is to check whether the elements from the range [1, N] can be divided into three non-empty equal sum… Read More »

Given two very large numbers L and R where L ≤ R, the task is to compute the sum of all the natural numbers from… Read More »

Given an integer N, the task is to find a permutation of the integers from 1 to N such that is maximum. Examples: Input: N… Read More »

Given an array arr[] of N integers, the task is to check if it is possible to redistribute the array such that for every 1… Read More »

Given an integer N, the task is to partition the first N natural numbers in two non-empty sets such that the sum of these set… Read More »

Given a N x N Chessboard. The task is to count distinct rectangles from the chessboard. For example, if the input is 8 then the… Read More »

There are infinite people standing in a row, indexed from 1. A person having index i has strength of i2. You have strength P and… Read More »