Skip to content

Category Archives: Arrays

Given an array arr[] and an integer K, the 0th index, the task is to collect the maximum score possible by performing the following operations:  … Read More
Given an array arr[] and an integer K, the task is to print the position of the array elements, where the ith value in the… Read More
Given two arrays arr1[] and arr2[], the task is to find the longest subarray of arr1[] which is a subsequence of arr2[]. Examples: Input: arr1[]… Read More
Given an integer N denoting the number of connected cities ( numbered from 1 to N ) and a 2D array arr[][] consisting of pairs… Read More
Given an array arr[] consisting of N integers and an array Q[][] consisting of queries of the form [L, R]., the task for each query… Read More
Given an array arr[] consisting of N integers representing N rods each with a disk of radius arr[i], the task is to check if it… Read More
Given an array arr[] consisting of N integers, the task is to count the number of ways to make the product of array elements even… Read More
Given an array arr[] consisting of N positive integers, the task is to determine the smallest positive integer K such that none of the array… Read More
Given two arrays of strings arr[] and brr[] of size N and M respectively, the task is to find the winner of the game when… Read More
Given an array arr[] of size N and a positive integer X, the task is to partition the array into the maximum number of subsets… Read More
Given two binary arrays arr1[] and arr2[] of the same size, the task is to make both the arrays equal by swapping pairs of arr1[… Read More
Given an array arr[] consisting of N integers which are either 0 or 7, the task is to find the largest number that can be… Read More
Prerequisite: Switch Statement in C/C++, Functions in C/C++, Loops in C and C++, C/C++ do-while loop with Examples Write a menu-driven program to perform below… Read More
Given an array arr[] consisting of N integers and a 2D array Q[][] consisting of queries of the following two types: 1 L R: Print… Read More