Arnab Chakraborty has Published 4293 Articles

Find array with k number of merge sort calls in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 12:03:31

134 Views

Suppose we have two numbers a and b, we have to find an array containing values in range [1, a] and requires exactly b number of calls of recursive merge sort function.So, if the input is like a = 10, b = 15, then the output will be [3, 1, ... Read More

Find an integer X which is divisor of all except exactly one element in an array in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 11:56:56

153 Views

Suppose we have an array of numbers; we have to find a number B which is the divisor of all except for exactly one element in the given array. We have to keep in mind that the GCD of all the elements is not 1.So, if the input is like ... Read More

Find an element which divides the array in two subarrays with equal product in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 10:01:27

154 Views

Suppose we have an array of size N; we have to find an element which divides the array into two different sub-arrays with equal product. Return -1 if no such partition is possible.So, if the input is like [2, 5, 3, 2, 5], then the output will be 3 then ... Read More

Find an element in an array such that elements form a strictly decreasing and increasing sequence in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 09:44:39

647 Views

Suppose we have an array of positive numbers; we have to check a point/item up to which items create a strictly decreasing sequence first followed by a sequence of strictly increasing integers. These are the following properties: We have to keep in mind that the sequences must be of minimum ... Read More

Find alphabetical order such that words can be considered sorted in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 09:40:02

161 Views

Suppose we have an array of words, we have to find any alphabetical order in the English alphabet so that the given words can be considered sorted in ascending order, if there is any such order exists, otherwise return "impossible".So, if the input is like words = ["efgh", "wxyz"], then ... Read More

Find all strings formed from characters mapped to digits of a number in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 09:32:19

260 Views

Suppose we have a character mapping as follows, here each digit, from 1 to 9, maps to few characters.1 -> ['A', 'B', 'C'] 2 -> ['D', 'E', 'F'] 3 -> ['G', 'H', 'I'] 4 -> ['J', 'K', 'L'] 5 -> ['M', 'N', 'O'] 6 -> ['P', 'Q', 'R'] 7 -> ... Read More

Find all rectangles filled with 0 in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 09:25:38

387 Views

Suppose we have a binary 2D matrix, now we have to find the beginning point and terminating point of all rectangles filled with 0s. We have to keep in mind that rectangles are separated and do not touch each other however they can touch the array boundary. A rectangle with ... Read More

Find all reachable nodes from every node present in a given set in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 09:18:13

645 Views

Suppose we have one undirected graph and a set of vertices; we have to find all reachable nodes from every vertex present in the given set.So, if the input is likethen the output will be [1, 2, 3] and [4, 5] as these are two connected components.To solve this, we ... Read More

Find all palindromic sub-strings of a given string - Set 2 in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 09:09:34

137 Views

Suppose we have a string; we have to find all the palindromic sub-strings from that string. Here aa and aa are considered as two sub-strings, not one.So, if the input is like redivider, then the output will be ['r', 'e', 'd', 'i', 'v', 'ivi', 'divid', 'edivide', 'redivider', 'i', 'd', 'e', ... Read More

Find all good indices in the given Array in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 08:59:25

555 Views

Suppose we have an array A of numbers, we have to find all indices of this array so that after deleting the ith element from the array, the array will be a good array. We have to keep in mind that −Good array is an array with an element that ... Read More

Advertisements