Arnab Chakraborty has Published 4293 Articles

Program to find number of quadruples for which product of first and last pairs are same in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:51:58

257 Views

Suppose we have a list of numbers called nums, with unique positive numbers nums. We have to find the number of quadruples like (a, b, c, d) from nums such that a*b = c*d, a, b, c and d all are distinct elements of nums.So, if the input is like ... Read More

Program to find number of operations needed to make pairs from first and last side are with same sum in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:49:34

113 Views

Suppose we have a list of numbers called nums. The length of this list is even. Now consider an operation where we select any number in nums and update it with a value in range [1 and maximum of nums]. We have to find the minimum number of such operations ... Read More

Program to find number of elements can be removed to make odd and even indexed elements sum equal in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:44:44

664 Views

Suppose we have a list of numbers called nums. Now consider a function say f(i) which deletes the element at index i and then returns true or false, depending the resulting list's sum of even index values is same as the sum of odd index values or not. So we ... Read More

Program to find number of islands, from where we cannot leave in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:42:17

161 Views

Suppose we have a binary matrix. Here 1 represents land and 0 represents water. From any land we can move up, down, left or right but not diagonally to another land cell or go off the matrix. We have to find the number of land cells from which we cannot ... Read More

Program to find stone removal rate in K hours in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:37:15

101 Views

Suppose we have a list of numbers called piles and a value k. The piles[i] represents, the number of stones on the pile i. On each hour, we select any pile and remove r number of stones from that pile. If we pick a pile with fewer than r stones, ... Read More

Program to find dropped correct sensor value from the faulty list in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:34:20

118 Views

Suppose we have two lists nums1 and nums2, they are representing sensor metrics. Each list contains unique values, so a ≠ b. One of these two lists are holding accurate sensor metrics but the other one contains faulty. In the faulty list one value, that is not the last value ... Read More

Program to count number of ways ball can drop to lowest level by avoiding blacklisted steps in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:32:08

230 Views

Suppose we have a value h and a list of numbers called blacklist. We are currently at height h, and are playing a game to move a small ball down to height 0. Now, in even rounds (starting from 0) we can move the ball 1, 2, or 4 stairs ... Read More

Program to count number of operations needed to make string as concatenation of same string twice in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:27:50

185 Views

Suppose we have a lowercase string s. Now consider an operation, where we can delete, insert or update any character in s. We have to count minimum number of operations required to make s = (t concatenate t) for any string t.So, if the input is like s = "pqrxqsr", ... Read More

Program to find length of smallest sublist that can be deleted to make sum divisible by k in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:16:36

205 Views

Suppose we have a list with positive values, called nums and also have a positive number k. We have to find the length of the shortest sublist (may be empty) that we can delete from nums, such that sum of the remaining elements is divisible by k. But we cannot ... Read More

Program to find minimum deletions to make strings strings in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Oct-2021 12:14:27

578 Views

Suppose we have two lowercase strings s and t, now consider an operation where we can delete any character in any of these two strings. We have to find the minimum number of operations needed to make s and t equal.So, if the input is like s = "pipe" t ... Read More

Advertisements