Skip to content

Category Archives: Arrays

Given an array arr[] of length N, the task is to maximize the number of distinct elements in the array by performing either of the… Read More
Given two Arrays A[] and B[] each of size N, the task is to check if the given arrays are valid or not, based on… Read More
Given an integer target which represents the total distance to be covered by a car on a straight road. Given another array, station[] of size… Read More
Given an array A[] containing N elements of an array and their frequency in that array (say arr[]), the task is to find the median… Read More
Given an array arr[] having N integers, the task is to find the GCD of all the numbers in the array which are not prime.… Read More
Given an array arr[] of size N such that the sum of all the array elements does not exceed N, and array queries[] containing Q… Read More
Given an array arr[] of size N representing the time taken by a person to complete a task. Also, an array restTime[] which denotes the… Read More
Given a binary array arr[] of size N, the task is to find the count of distinct alternating triplets. Note: A triplet is alternating if… Read More
Given an array arr[] which contains N positive integers and an integer K. The task is to count all triplets whose XOR is equal to… Read More
Given an array arr[] of length N (N > 1)containing positive integers, the task is to encrypt the numbers of the array into a single… Read More
Given an array arr[] of size N consisting of positive integers, the task is to check if the array can be sorted in non-decreasing order… Read More
Given an array of integers arr[] of size N and an integer K, the task is to find the smallest prime such that it gives… Read More
Given an array arr[] of size N initially filled with 0 and another array Positions[] of size M, the task is to return the maximum… Read More
Given a binary array arr[] of size N, the task is to find the count of distinct alternating triplets. Note: A triplet is alternating if… Read More
Given an array arr[] of integers of length N, the task is to find the product of the sum of all the numbers larger than… Read More

Start Your Coding Journey Now!