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....
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....
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:...
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....
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:...
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:...
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....
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....
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:...
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....
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”....
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....