Skip to content

Category Archives: Arrays

Given an array arr[] consisting of N integers and an integer K, the task is to check if the sum of the array can be… Read More
Given an array arr[] and an integer K, the task is to find the array element from indices not divisible by K whose product of… Read More
Given an array arr[] of size N consisting of only of 0s initially, the task is to count the number of 1s that can be… Read More
Given an array arr[] of size N, the task is to find the maximum sum non-empty subsequence present in the given array. Examples: Input: arr[]… Read More
Given two arrays arr[] and brr[] consisting of N and K elements respectively, the task is to find the maximum subarray sum possible from the… Read More
Given an array arr[] of length N consisting of positive integers, the task is to find the longest increasing subsequence that can be formed by… Read More
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and… Read More
Given an array A[] consisting of N integers, the task is to find the minimum difference between the largest and the smallest element in the… Read More
Given a 2D array knights[][] of size N * 2, with each row of the form { X, Y } representing the coordinates of knights,… Read More
Given an array arr[] of size N, the task is to find the winner of the game when two players play the game optimally as… 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 an array A[] consisting of N integers, where each value represents the marks of the ith student, the task is to find the minimum… Read More
Given an array arr[] of size N, the task is to find the smallest indexed array element whose sign needs to be flipped such that… Read More
Array: An array is a collection of homogeneous(same type) data items stored in contiguous memory locations. For example, if an array is of type “int”,… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to count the number of array elements having exactly K… Read More