Skip to content

Category Archives: C++ Programs

Time Complexity: O((len(str))1/2) Auxiliary Space: O(len(str))Time Complexity: O((l Given a string of lowercase English alphabets. The task is to check if the count of distinct… Read More
Given an integer and two integer arrays H[] and C[] of size where H[] stores the height of consecutive buildings and C[] stores the color codes for… Read More
Given two arrays div and rem which hold the values for divisors and remainders, the task is to find the number which after being successively… Read More
Given and denoting that the Cost Price of N articles is equal to the Selling Price of M articles. The task is to determine the profit or… Read More
Given an integer N, where . The task is to print the count of pieces of a circle with N cuts where each cut passes through… Read More
Given a string, the task is to count the number of words whose sum of Ascii values is less than and greater than or equal… Read More
Given the number of lines as N, the task is to form the given hollow Triangle pattern.Examples:   Input: N = 6 Output: ************ ***** *****… Read More
Given an array with N distinct elements. The task is to find the minimum number of elements to be changed in the array such that,… Read More
Pre-requisite: Operator Overloading in C++Given two strings. The task is to concatenate the two strings using Operator Overloading in C++. Example:  Input: str1 = "hello",… Read More
Pre-requisite: Friend FunctionCASE 1: Given two numbers a & b, swap these two numbers using friend function of C++.  Examples:  Input : a = 5, b… Read More
Given two strings, compare the strings using pointers Examples: Input: str1 = geeks, str2 = geeks Output: Both are equal Input: str1 = hello, str2… Read More
Given a C++ program and the task is to break the entire program in the form of Makefile. It is basically used to create .cpp… Read More
Prerequisite : multiset The multiset::erase() is the STL function in C++ removes the specified element from multiset. There are three versions of this method. These… Read More
Given an array of size N and an integer K, find the minimum for each and every contiguous subarray of size K. Examples: Input :… Read More
Given a regular hexagon of side length a, the task is to find the length of it’s diagonal.Examples:   Input : a = 4 Output :… Read More

Start Your Coding Journey Now!