## Number of valid indices in the permutation of first N natural numbers

Given a permutation P of first N natural numbers. The task is to find the number of i’s such that Pi ≤ Pj for all… Read More »

- Program to find the last two digits of x^y
- Find the smallest positive number missing from an unsorted array | Set 3
- Program to find the Nth Prime Number
- Maximum subsequence sum such that all elements are K distance apart
- Count of integers in a range which have even number of odd digits and odd number of even digits
- Remove Nth node from end of the Linked List
- Puzzle | Disclosing Secret
- Make the list non-decreasing by changing only one digit of the elements
- Check if the sum of digits of number is divisible by all of its digits
- Count of integers that divide all the elements of the given array
- Number of Subsequences with Even and Odd Sum
- Find the sum of all possible pairs in an array of N elements
- Nth XOR Fibonacci number
- Minimum number of Bottles visible when a bottle can be enclosed inside another Bottle
- Maximum Sequence Length | Collatz Conjecture
- Print all the permutation of length L using the elements of an array | Iterative
- Count number of ways to get Odd Sum
- Number of substrings that start with "geeks" and end with "for"
- Fibonacci Number modulo M and Pisano Period
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Count occurrences of a prime number in the prime factorization of every element from the given range
- Minimum cost to make all array elements equal
- 21 Matchsticks Problem
- Count number of pairs in array having sum divisible by K | SET 2
- Round the given number to nearest multiple of 10 | Set-2
- Find two integers A and B such that A ^ N = A + N and B ^ N = B + N
- Iterative program to generate distinct Permutations of a String
- Number of Subarrays with positive product
- Color all boxes in line such that every M consecutive boxes are unique
- Find the kth smallest number with sum of digits as m

Given a permutation P of first N natural numbers. The task is to find the number of i’s such that Pi ≤ Pj for all… Read More »

Given an array arr[], the task is to check if sum of all elements of an array is equal to XOR of all elements of… Read More »

Given an array arr[] with N distinct numbers and another array arr1[] with N-1 operators (either < or >), the task is to organize the… Read More »

Given an array arr[] of N positive integers, the task is to count all the subarrays where the sum of subarray elements is strictly greater… Read More »

Given two integers S and D, the task is to find the number having D number of digits and the sum of its digits as… Read More »

Given a matrix arr[][] of size MxN, the task is to find the number of contiguous palindromic sequences of odd length in that matrix. Example:… Read More »

Given an array arr[] of length N, the task is to count the number of pairs (X, Y) such that XY is even and count… Read More »

Given two integers A and B, the task is to calculate the number of pairs (a, b) such that 1 ≤ a ≤ A, 1… Read More »

Given a distance N. The task is to count the total number of ways to cover the distance with 1, 2 and 3 steps. Examples:… Read More »

Given an integer N. The task is to reduce the given number N to 1 in minimum number of given operations. You can perform any… Read More »

Given an integer N, the task is to find the minimum integer that can be obtained from the given integer such that the adjacent digits… Read More »

Jaro Similarity Jaro Similarity is the measure of similarity between two strings. The value of Jaro distance ranges from 0 to 1. where 1 means… Read More »

Given an integer N, the task is to count the number of binary strings possible such that there is no substring of length ≥ 3… Read More »

Given an integer array arr[], the task is to count the number of partitions possible such that in each partition the minimum element divides all… Read More »

Given an integer X, the task is to partition its digit into two groups either A or B such that the sequence of digits is… Read More »