C++ Programs - Hard Articles
The article explains how to store the reverse of the first text file’s data to a second text file. In this post, it has been… Read More
Given a string str, the task is to check whether all the substrings of length ? 2 have the number of vowels at least as… Read More
Given an input string which is comma-separated instead of space, the task is to parse this input string in C++.First, let us understand what difference… Read More
Given a vector, the task is to erase an element from this vector using erase() and reverse_iterator. Example: Input: vector = {1, 4, 7, 10,… Read More
Given a string str consisting of lowercase English alphabets, the task is to find the count of all possible string of maximum length that can… Read More
Given an array of integers Arr. The task is to count the number of triplets (i, j, k) such that Ai ^ Ai+1 ^ Ai+2… Read More
Given a string str and an integer L. The task is to print all the unique substring of length L from string str. Examples:  Input: str… Read More
Given an array arr[] of N integers, the task is to find the count of subarrays with negative product.Examples:  Input: arr[] = {-1, 2, -2} Output:… Read More
Given an array arr[] of strings. The task is to sort the array in lexicographical order using Heap Sort.Examples:   Input: arr[] = { “banana”, “apple”,… Read More
Given an array arr of size N. The task is to find the kth smallest element in the subarray(l to r, both inclusive).  Note : … Read More
Given a tree and a node, the task is to reverse the path till the given Node and print the in-order traversal of the modified… Read More
Given an array of strings arr[], the task is to find the largest string in the array which is made up of the other strings… Read More
Given an array of size N. There can be multiple queries of the following types.   update(l, r) : On update, flip( multiply a[i] by -1)… Read More
Given a string str containing lowercase alphabets, the task is to count the sub-strings that contain all the vowels at-least one time and there are… Read More
INTRODUCTION: Gap Buffer is a data structure for the dynamic insertion and deletion of elements in a buffer or an array. It represents a buffer… Read More
Given a string, find a prefix with the highest frequency. If two prefixes have the same frequency then consider the one with the maximum length.… Read More
Given an array arr[] of integers, the task is to find the maximum sum sub-array among all the possible sub-arrays.Examples:   Input: arr[] = {-2, 1,… Read More
Given an array A[] containing N elements and an integer K. The task is to calculate the product of all elements of subsequences of size… Read More
Given a number N, the task is to find the Prime Numbers from 1 to N using Command Line Arguments. Examples:  Input: N = 7Output:… Read More