Javascript Program for Minimum product subset of an array
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can be a single element also....
read more
Javascript Program to Maximize sum of diagonal of a matrix by rotating all rows or all columns
Given a square matrix, mat[][] of dimensions N * N, the task is find the maximum sum of diagonal elements possible from the given matrix by rotating either all the rows or all the columns of the matrix by a positive integer....
read more
Javascript Program for Check whether all the rotations of a given number is greater than or equal to the given number or not
Given an integer x, the task is to find if every k-cycle shift on the element produces a number greater than or equal to the same element. A k-cyclic shift of an integer x is a function that removes the last k digits of x and inserts them in its beginning. For example, the k-cyclic shifts of 123 are 312 for k=1 and 231 for k=2. Print Yes if the given condition is satisfied else print No.Examples:...
read more
Php Program for Minimum product subset of an array
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can be a single element also....
read more
Php Program to Check if it is possible to sort the array after rotating it
Given an array of size N, the task is to determine whether its possible to sort the array or not by just one shuffle. In one shuffle, we can shift some contiguous elements from the end of the array and place it in the front of the array.For eg:...
read more
Javascript Program to Check if it is possible to sort the array after rotating it
Given an array of size N, the task is to determine whether its possible to sort the array or not by just one shuffle. In one shuffle, we can shift some contiguous elements from the end of the array and place it in the front of the array.For eg:...
read more
Javascript Program to Find Maximum number of 0s placed consecutively at the start and end in any rotation of a Binary String
Given a binary string S of size N, the task is to maximize the sum of the count of consecutive 0s present at the start and end of any of the rotations of the given string S....
read more
How to find Shortest Paths from Source to all Vertices using Dijkstra’s Algorithm
Given a weighted graph and a source vertex in the graph, find the shortest paths from the source to all the other vertices in the given graph....
read more
C++ Program to Check whether all the rotations of a given number is greater than or equal to the given number or not
Given an integer x, the task is to find if every k-cycle shift on the element produces a number greater than or equal to the same element. A k-cyclic shift of an integer x is a function that removes the last k digits of x and inserts them in its beginning. For example, the k-cyclic shifts of 123 are 312 for k=1 and 231 for k=2. Print Yes if the given condition is satisfied else print No.Examples:...
read more
Generate an N-length array having maximum element minimized and sum of array elements divisible by K
Given two positive integers N and K, the task is to minimize the maximum element of the array formed such that the sum of array elements is positive and divisible by K....
read more
Pair of integers with difference K having an element as the K-th multiple of the other
Given an integer K, the task is to find a pair of numbers (A, B) such that A – B = K and A / B = K. If no such pair can be generated, print “No”....
read more
Maximum length of consecutive 1s or 0s after flipping at most K characters
Given a binary string S of size N and an integer K, the task is to find the maximum length of consecutive 1s or 0s after flipping at most K characters of the given binary string S....
read more