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… Read More
Category Archives: C++
We have one 2D array, filled with zeros and ones. We have to find the starting point and ending point of all rectangles filled with… Read More
Given an array arr[] and an integer k, we need to print k maximum elements of given array. The elements should printed in the order… 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 a matrix mat[][] of dimensions M * N, the task is to print the matrix obtained after rotating every ith row of the matrix… Read More
What is a tuple? A tuple in C++ is an object which binds a group of elements together. The elements can be similar as well… Read More
Sets are a type of associative container in which each element has to be unique because the value of the element identifies it. The values… Read More
find() function finds the element in the given range of numbers. Returns an iterator to the first element in the range [first, last) that compares… Read More
Given a square matrix and the task is to check the matrix is in upper triangular form or not. A square matrix is called upper… Read More
Given an array arr[] of size N, the task is to check if it is possible to convert all of the array elements to a… Read More
Given an integer X and two strings S1 and S2, the task is to check that string S1 can be converted to the string S2… 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 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 a large positive number as string, count all rotations of the given number which are divisible by 8. Examples: Input: 8 Output: 1 Input:… Read More
Given a binary array arr[] containing N integer elements, the task is to create a string s which contains all N elements at the same… Read More