Arnab Chakraborty has Published 4452 Articles

C++ program to find out the maximum number of cells a cleaning robot can clean in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Feb-2022 07:31:48

467 Views

Suppose, we are making a cleaning robot that works on a grid. The grid is of dimensions h x w. There are m dirty cells that need to be cleaned that are given in an array of integer pairs 'dirt'. The cleaning robot, if placed in a particular cell; can ... Read More

Program to find coefficients of linear equations that has only one solution in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 08:11:57

421 Views

Suppose we have a value n, we have to find the number of pairs (a, b) [a < b], that exist such that the equation a*x + b*y = n, has at least one solution.So, if the input is like n = 4, then the output will be 2 because ... Read More

Program to find number m such that it has n number of 0s at end in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 08:08:24

83 Views

Suppose we have a number n. We have to find smallest number m, such that factorial of m has at least n number of 0s.So, if the input is like n = 2, then the output will be 10 because 10! = 3628800 and 9! = 362880, minimum number with ... Read More

Program to find hoe many children will get candies while distributing them maintaining the rules in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 08:05:08

244 Views

Suppose we have k number of candies. We have to distribute them among children. Now there are some rulesith child will get i^2 number of candiesany children at index i will not get any candy until all children from index 1 to i-i are servedIf ith children does not get ... Read More

Program to find remainder after dividing n number of 1s by m in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 08:02:07

376 Views

Suppose we have two numbers n and m. We have to find the remainder after dividing n number of 1s by m.So, if the input is like n = 4 m = 27, then the output will be 4, because 1111 mod 27 = 4.To solve this, we will follow ... Read More

Program to find number of pairs from N natural numbers whose sum values are divisible by k in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:59:43

200 Views

Suppose we have a number n and another value k, consider we have an array A with first N natural numbers, we have to find the total number of pairs of elements A[i] and A[j] from A, such that, i < j and their sum is divisible by k.So, if ... Read More

Program to find common fraction between min and max using given constraint in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:55:26

271 Views

Suppose we have two long integer values maximum and minimum. We have to find a common fraction n/d such that min

Program to find probability that any proper divisor of n would be an even perfect square number in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:50:08

76 Views

Suppose we have a number n, we have to find out the probability that any proper divisor of n would be an even perfect square.So, if the input is like n = 36, then the output will be 1/8 because there are eight proper divisors of 36, these are {1, ... Read More

Program to find value of find(x, y) is even or odd in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:43:58

185 Views

Suppose we have an array nums. We also have another pair (x, y), we need to find whether the value find(x, y) is Odd or Even. The find() is as followsfind(x, y) = 1 if x > yfind(x, y) = nums[x]^find(x+1, y) otherwiseSo, if the input is like nums = ... Read More

Program find number of subsets of colorful vertices that meets given conditions in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Oct-2021 07:41:12

74 Views

Suppose we have an array colors, representing colors for one regular n-gon. Here each vertex of this n-gon was randomly colored with one of n different colors present in the given array. We have to find the number of special subsets of polygon vertices, such that these subsets meet these ... Read More

Advertisements