Skip to content

Tag Archives: cpp-vector

Given two arrays L[] and R[] of size N, and an integer K, the task is to find the number of ways to select exact… Read More
Given a matrix arr[][] of size NxM and an integer K, the task is to find the count of square submatrices in the given matrix… Read More
Given a sac of capacity W, and two arrays A[] and B[] of length N, where A[i] represents the weight of an ith block of… Read More
Given N persons are standing in a circle and an integer K. If initially starting from the first position, the Kth alive person clockwise from… Read More
Given a rectangular matrix mat[][] with N rows and M columns, the task is to rotate the matrix by 90 degrees in a clockwise direction… Read More
In C++, vectors are dynamic arrays, that can grow or shrink and their storage is handled by the container itself. There are two ways of… Read More
Given an array of strings arr[] consisting of lowercase and uppercase characters only, the task is to modify the array by removing the characters from… Read More
Given two arrays arr[] and jump[], each of length N, where jump[i] denotes the number of indices by which the ith element in the array… Read More
Prerequisite: Vectors in C++ STL Vectors are known as dynamic arrays with the ability to resize themselves automatically when an element is inserted or deleted,… Read More
Given a 2D array segments[][] where each segment is of the form [L, R] representing (X, Y) co-ordinates, the task is to find a segment… Read More
Given an array order[] consisting of N integers and an integer X, the task is to perform integer division on the array elements by X… Read More
Given two integers N and K, the task is to find whether it is possible to represent N as the sum of exactly K powers… Read More
Given a positive integer N, the task is to find the count of all the numbers M such that when the number N is divided… Read More
Given two arrays A[ ] and B[ ] consisting of N integers, where Ai denotes the quantity of sweets of the ith type and Bi… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the Kth smallest element in the array using… Read More