Given a string S and two positive integers X and Y, the task is to find the minimum number of operations required to obtain the… Read More

# Tag Archives: interview-preparation

Given a string S consisting of lowercase alphabets of size N, the task is to count all substrings which contains the most frequent character in… Read More

Given a matrix mat[][] of N * M dimensions, the task is to print the elements of the matrix using a single for loop. Examples:… Read More

Given a 2D array arr[][] consisting of N rows of the form {Xi, Yi, Ri} such that (Xi, Yi) represents the position of a tower… Read More

Given a string S of length N consisting of ‘x’ and ‘.’. The given string represents a row of seats where ‘x’ and ‘.’ represent… Read More

Given an array of strings arr[] representing the change folder operations(Unix-style) performed on the file system. Initially, the file system opens in the main folder.… Read More

Problem: In one pass, Train A can start from the source station at time T[0], halt at each station for h unit of time until… Read More

Given an array wood[] of size N, representing the length of N pieces of wood and an integer K, at least K pieces of the… Read More

Given an array arr[] of size N and an integer S, the task is to find the count of quadruplets present in the given array… Read More

Given an array arr[] consisting of N positive integers, the task is to maximize the sum of the array element such that the first element… Read More

Given an array arr[] of N positive integers with an equal number of even and odd elements. The task is to use in-place swapping to… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to find the count of array elements having rank at… Read More

Given two integers N and B, the task is to print the maximum index a pointer, starting from 0th index can reach in an array… Read More

There is a one-dimensional garden of length N. In each position of the N length garden, a fountain has been installed. Given an array a[]such… Read More