Given an array arr[] consisting of N positive integers, the task is to find the number of array elements whose count of divisors is a… Read More

# Category Archives: Arrays

Given two positive integers A, B, and an array D[] consisting only of digits [0-9], the task is to check if it is possible to… Read More

Given an array arr[] consisting of N strings, the task is to sort the array in ascending order after modifying each string by removing all… Read More

Given a string S consisting of N lowercase alphabets and an array of pairs of characters P[][2], the task is to modify the given string… Read More

Given an array arr[] consisting of N integers, the task is to find the maximum value of (arr[i] + arr[j] + i − j) for… Read More

Given an array arr[] consisting of N integers, the task is to find the last remaining array element after removing every second element, starting from… Read More

Given an array arr[] consisting of N integers and integer K, the task is to find the smallest integer X with exactly K set bits… Read More

Count triplets (i, j, k) in an array of distinct elements such that a[i] < a[j] > a[k] and i < j < k

Given an array arr[] consisting of N distinct integers, the task is to count the number of triplets (i, j, k) possible from the array… Read More

Given an array arr[] consisting of N integers and an array Q[][2] consisting of M queries of the form {L, R}, the task for each… Read More

Given a circular array arr[] consisting of N integers, the task is to find the starting index of the circular array such that the prefix… Read More

Given a square symmetric matrix mat[][] of size N, the task is to find the minimum sum possible of an array arr[] of size N,… Read More

Given an array weight[] consisting of weights of N items and a positive integer C representing the capacity of each bin, the task is to… Read More

Given an array arr[] consisting of N positive integers and a 2D array Q[][] consisting of queries of the type {i, val}, the task for… Read More

Given an array arr[] consisting of N positive integers, the task is to find the LCM of all unique elements of the given array. If… Read More

Given an array arr[] consisting of N binary strings, and two integers A and B, the task is to find the length of the longest… Read More