Skip to content

Category Archives: Mathematical

Given an integer K and an array arr[] consisting of N integers, where an array element arr[i] represents the price of the ith book. Profit… Read More
Given an array arr[] consisting of N positive integers, the task is to find the number of array elements whose highest power of 2 less… Read More
Given a string S consisting of N characters, the task is to print all palindromic strings of length 3 in lexicographical order that can be… Read More
Given an array arr[] consisting of N integers, the task is to find the largest number K (> 0) such that both the values K… Read More
Given an array arr[] consisting of N integers, the task is to repeatedly remove elements that are smaller than the next element. Examples: Input: arr[]… Read More
Given two strings X and Y consisting of N and M characters, the task is to find the longest subsequence of a string X which… Read More
Given four integers N, M, A, and B, the task is to print all numbers ( in increasing order ) that can be obtained by… Read More
Given an array arr[] of size N, representing the diameter of N circular buildings and a straight wire of length L. The task is to… Read More
Given a binary string S of size N, the task is to find the minimum non-negative integer which is not a subsequence of the given… Read More
Given a string, str of length N and a character X, the task is to find the maximum count of characters X that are to… Read More
Given three integers A, B and C. You can add or substract A, B, or 0 any number of times to form new values in… Read More
Given an array arr[] consisting of N positive integers, the task is to print the nearest perfect square for each array element. Examples: Input: arr[]… Read More
Given an array arr[] consisting of N integers, the task is to re-construct an array arr[] such that the values in arr[] are obtained by doing… Read More
Given two arrays A[] and B[], both consisting of N positive integers, the task is to find the maximum score among all possible same-indexed subarrays… Read More
Given an array arr[] consisting of N non-negative integers, the task is to find the minimum length of the subarray whose sum is maximum. Example:… Read More