Tag Archives: rotation

Given two integers N and K, the task is to rotate the digits of N by K. If K is a positive integer, left rotate… Read More
Given an array arr[] consisting of N integers, the task is to sort the array in non-increasing order by minimum number of anti-clockwise rotations. If… Read More
Given a square matrix, mat[][] of dimensions N * N, the task is find the maximum sum of diagonal elements possible from the given matrix… Read More
Given an integer N, the task is to generate a matrix of dimensions N x N using positive integers from the range [1, N] such… Read More
Given an array arr[] of N integers and Q queries of the form {X, Y} of the following two types: If X = 1, rotate… Read More
Given a string S of lowercase English alphabets, the task is to find the minimum number of characters to be changed such that the left… Read More
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
Given a matrix mat[][] of size N*N, the task is to rotate the matrix by 45 degrees and print the matrix. Examples: Input: N =… Read More
Given non-negative integers K, M, and an array arr[ ] consisting of N elements, the task is to find the Mth element of array after… Read More
Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:… Read More
Given an array arr[] of size N and D index, the task is to rotate the array by the D index. Left Rotate: Array rotate… Read More
Given a permutation arrays A[] consisting of N numbers in range [1, N], the task is to left rotate all the even numbers and right… Read More
Given two permutations P1 and P2 of numbers from 1 to N, the task is to find the maximum count of corresponding same elements in… Read More
Given an integer array arr[] of size N, the task is to print all possible rotations of the array.Examples:  Input: arr[] = {1, 2, 3,… Read More