Arnab Chakraborty has Published 4293 Articles

Find maximum points which can be obtained by deleting elements from array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Jul-2020 08:52:43

144 Views

ConceptWith respect of a given array A having N elements and two integers l and r where, 1≤ ax ≤ 105 and 1≤ l≤ r≤ N. We can select any element of the array (let’s say ax) and delete it, and also delete all elements equal to ax+1, ax+2 … ... Read More

Find maximum operations to reduce N to 1 in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Jul-2020 08:49:31

132 Views

ConceptWith respect of given two numbers P and Q ( P and Q can be up to 10^6 ) which forms a number N = (P!/Q!). Our task is to reduce N to 1 by performing maximum number of operations possible. Remember, in each operation, one can replace N with ... Read More

Find maximum N such that the sum of square of first N natural numbers is not more than X in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Jul-2020 08:45:08

465 Views

ConceptWith respect of a given integer X, our task is to determine the maximum value N so that the sum of first N natural numbers should not exceed X.InputX = 7Output22 is the maximum possible value of N because for N = 3, the sum of the series will exceed ... Read More

Find maximum length Snake sequence in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Jul-2020 08:42:11

316 Views

ConceptWith respect of a given grid of numbers, determine maximum length Snake sequence and display it. It has been observed that if multiple snake sequences exist with the maximum length, display any one of them.Actually, a snake sequence is made up of adjacent numbers in the grid so that for ... Read More

Find maximum distance between any city and station in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Jul-2020 08:36:46

454 Views

ConceptWith respect of the given number of cities N numbered from 0 to N-1 and the cities in which stations are located, our task is to determine the maximum distance between any city and its nearest station. It should be noted that the cities with stations can be given in ... Read More

Find maximum difference between nearest left and right smaller elements in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 12:04:51

365 Views

ConceptWith respect of a given an array of integers, our task is to determine the maximum absolute difference between the nearest left and the right smaller element of every element in the array. It should be noted that if there is no smaller element on right side or left side ... Read More

Find lost element from a duplicated array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 12:02:27

156 Views

ConceptWith respect of given two arrays which are duplicates of each other except one element, that means one element from one of the array is missing, our task to determine that missing element.Inputarr1[] = {2, 5, 6, 8, 10} arr2[] = {5, 6, 8, 10}Output22 is missing from second array.Inputarr1[] ... Read More

Find longest bitonic sequence such that increasing and decreasing parts are from two different arrays in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 11:58:21

202 Views

ConceptWith respect of given two arrays, our task to determine the longest possible bitonic sequence so that increasing part must be from first array and should be a subsequence of first array. In the same way, decreasing part of must be from second array and should be a subsequence of ... Read More

Find longest palindrome formed by removing or shuffling chars from string in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 11:56:17

210 Views

ConceptWith respect of a given string, determine the longest palindrome that can be formed by removing or shuffling characters from the string. Finally return only one palindrome if it hasbeen observed that there is multiple palindrome strings of longest length.InputpqrOutputp OR q OR rInputppqqrrOutputpqrrqp OR qprrpq OR rqppqr OR any ... Read More

Find k-th character of decrypted string - Set – 2 in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 11:45:39

183 Views

ConceptWith respect of a given encoded string where repetitions of substrings are indicated as substring followed by count of substrings. So, for example, if encrypted string is “pq2rs2” and k=5, so output will be ‘r’ because decrypted string is “pqpqrsrs” and 5th character is ‘r’.It should be noted that frequency ... Read More

Advertisements