Given a string S of length N and an array of queries A[] of size M, the task is to find the final string after… Read More
Tag Archives: Reverse
Given an array arr[] of length N consisting of uppercase English letters only and a letter ch. the task is to find the final array… Read More
Given the linked list and an array arr[] of size N, the task is to reverse every arr[i] nodes of the list at a time… Read More
Given a string S and an integer K, the task is to find the lexicographically smallest string possible after reversing any substring of any length… Read More
Given an array arr[] of even length N, the task is to perform the following operations on the given array: Split the given array in… Read More
Given a stack S and an integer K, the task is to reverse the first K elements of the given stack Examples: Input: S = [… Read More
Given a 32-bit integer N. The task is to reverse N, if the reversed integer overflows, print -1 as the output. Examples Input: N =… Read More
Given a doubly-linked list containing n nodes. The problem is to reverse every group of k nodes in the list. Examples: Input: List: 10<->8<->4<->2, K=2Output:… Read More
Given a linked list lis of length N, where N is even. The task is to maximize the sum of two equidistant nodes from the… Read More
Given an array arr[] of size N and an integer P, the task is to find the original array from the array obtained by P… Read More
Given an array arr[] of size N and an integer P (P < N), the task is to find the original array from the array… Read More
Given a matrix arr[][] of size M*N, where M is the number of rows and N is the number of columns. The task is to… Read More
Given two strings str1 and str2 and an integer d, the task is to check whether str2 can be obtained by rotating str1 by d… Read More
Given two strings str1 and str2 and an integer d, the task is to check whether str2 can be obtained by rotating str1 by d… Read More
Given two strings str1 and str2 and an integer d, the task is to check whether str2 can be obtained by rotating str1 by d… Read More