Arnab Chakraborty has Published 4293 Articles

Find the minimum number of rectangles left after inserting one into another in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 08:28:52

220 Views

Suppose we have width and height of N different rectangles; we have to find the minimum number of rectangles left after inserting one into another. So, if W1 and W2 be the width of rectangles R1 and R2 respectively. And H1 and H2 be the height of R1 and R2 ... Read More

Find the minimum number of moves needed to move from one cell of matrix to another in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 08:23:08

374 Views

Suppose we have one N X N matrix M, and this is filled with 1, 0, 2, 3, We have to find the minimum numbers of moves required to move from source cell to destination cell. While visiting through blank cells only, we can visit up, down, right and left.Cell ... Read More

Find the minimum number of preprocess moves required to make two strings equal in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 08:15:59

267 Views

Suppose we have two strings P and Q of same lengths with only lower case letters, we have to count the minimum number of pre-processing moves on string P are needed to make it equal to string Q after applying below operations −Select any index i and swap characters pi ... Read More

Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 08:03:50

414 Views

Suppose we have a given unsorted array A[0..n-1] of size n, we have to find the minimum length subarray A[s..e] so that by sorting this subarray the whole array will be sorted. So, if the array is like [2, 6, 4, 8, 10, 9, 15], then the output will be ... Read More

Find the minimum difference between Shifted tables of two numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 08:02:29

158 Views

Suppose we have two numbers p and q, we have to find the minimum difference between any terms in the shifted infinite tables of p and q, these shifts are r and s, where r, s >= 0.So, if the input is like p = 7 and q = 17, ... Read More

Find the minimum and maximum amount to buy all N candies in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 07:59:39

961 Views

Suppose there is a candy store where N different types of candies are available and the prices of all N different types of candies are given. The store also provides an attractive offer. According to this offer, we can buy a single candy from the store and get maximum of ... Read More

Find the maximum repeating number in O(n) time and O(1) extra space in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 07:58:19

602 Views

Suppose we have an array of size n, if the elements in the array, are in range from 0 to k-1. Where k is denoted as a positive integer and k max_val, thenmax_val := A[i]result := ireturn resultExample Let us see the following implementation to get better understanding − Live Demodef ... Read More

Find the maximum number of composite summands of a number in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 07:56:44

251 Views

Suppose we have a given number N that in range (1= j and table[i - j] != -1):             table[i] = max(table[i], table[i - j] + 1)    return table def max_summ(table, n):    if (n < max_val):       return table[n]    else: ... Read More

Find the maximum distance covered using n bikes in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 07:55:18

544 Views

Suppose there are n bikes and each can cover 100 km when they are fully fueled. We have to find the maximum amount of distance we can go using these n bikes. Here we can assume that all bikes are similar and a bike consumes 1 litre of fuel to ... Read More

Find the maximum cost of an array of pairs choosing at most K pairs in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2020 07:53:46

204 Views

Suppose we have an array of pairs A; we have to find the maximum cost for selecting at most K pairs. In this case, the cost of an array of pairs type elements is the product of the sum of first elements of the selected pair and the smallest among ... Read More

Advertisements