Javascript Program to Count rotations which are divisible by 10
Given a number N, the task is to count all the rotations of the given number which are divisible by 10.Examples:...
read more
Javascript Program for Longest subsequence of a number having same left and right rotation
Given a numeric string S, the task is to find the maximum length of a subsequence having its left rotation equal to its right rotation....
read more
Php Program for Counting sets of 1s and 0s in a binary matrix
Given a n × m binary matrix, count the number of sets where a set can be formed one or more same values in a row or column. Examples:...
read more
Maximize count of indices with same element by pairing rows from given Matrices
Given two 2D binary arrays, a[][] and b[][] both of size M*N, the task is to pair each row in the array a[][] with any row in the array b[][] such that the total score can be maximized and the score for each pair is calculated as the total indexes at which values of both rows are identical....
read more
Sort decreasing permutation of N using triple swaps
Given an array A[] consisting of decreasing permutation of N numbers, the task is to sort the array using triple swaps. If it is not possible to sort the array then print -1....
read more
Minimum adjacent swaps of digits required to make N divisible by K
Given two integers N and K, the task is to calculate the minimum number of adjacent swaps of digits required to make the integer N divisible by K....
read more
Check if all objects of type A and B can be placed on N shelves
Given two integers A and B, representing the count of objects of two different types, and another integer N which represents the number of shelves, the task is to place all objects in the given N shelves abiding by the following rules:...
read more
Longest subsequence of a number having same left and right rotation
Given a numeric string S, the task is to find the maximum length of a subsequence having its left rotation equal to its right rotation....
read more
Classification of Algorithms with Examples
There are many ways of classifying algorithms and a few of them are shown below:...
read more
Permutations of a given string using STL
A permutation, also called an “arrangement number” or “order”, is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself. A string of length n has n! permutation. Source: Mathword...
read more
Count subsequences having odd Bitwise XOR values from an array
Given an array A[] of size N, the task is to count the number of subsequences from the given array whose Bitwise XOR value is odd....
read more
Number of subsets with same AND, OR and XOR values in an Array
Given an array arr[] of size N consisting of non-negative integers, the task is to find the number of non-empty subsets of the array such that the bitwise AND, bitwise OR and bitwise XOR values of the subsequence are equal to each other....
read more