Skip to content

Category Archives: C++

Given an array of integers. Write a program to find the K-th largest sum of contiguous subarray within the array of numbers which has negative… Read More
Given a square matrix of order n*n, you have to interchange the elements of both diagonals. Examples :   Input : matrix[][] = {1, 2, 3, 4,… Read More
A square matrix is said to be symmetric matrix if the transpose of the matrix is same as the given matrix. Symmetric matrix can be… Read More
Given an array arr[]. Find the maximum value of prefix sum which is also suffix sum for index i in arr[]. Examples :  Input :… Read More
Given 3 arrays (A, B, C) which are sorted in ascending order, we are required to merge them together in ascending order and output the… Read More
Given two strings s1 and s2, check whether s2 is a rotation of s1. Examples:  Input : ABACD, CDABA Output : True Input : GEEKS, EKSGE… Read More
Given an array of even number of elements, form groups of 2 using these array elements such that the difference between the group with highest… Read More
Given an array and split it from a specified position, and move the first part of array add to the end.   Examples:   Input : arr[]… Read More
You are given an array on n-elements. An extrema is an elements which is either greater than its both of neighbors or less than its… Read More
Given an array, find the least frequent element in it. If there are multiple elements that appear least number of times, print any one of… Read More
Given a string str, the task is to perform the following type of queries on the given string:   (1, K): Left rotate the string by… Read More
Given an integer n, the task is to generate all the left shift numbers possible. A left shift number is a number that is generated… Read More
We have a sorted array with duplicate elements and we have to find the index of last duplicate element and print index of it and… Read More
Given a matrix of order m*n then the task is to find the frequency of even and odd numbers in the matrix Examples:  Input : m… Read More