Arnab Chakraborty has Published 4293 Articles

C++ Program to find out the number of jumps needed for a robot to reach a particular cell in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Feb-2022 10:46:30

255 Views

Suppose, we have a grid of dimensions h x w. The grid is represented in a 2D array called ‘initGrid’, where each cell in the grid is either represented by a '#' or a '.'. '#' means that the grid contains an obstacle and '.' means that there is a ... Read More

C++ Program to find out the number of unique matrices that can be generated by swapping rows and columns

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Feb-2022 10:31:41

189 Views

Suppose, we have a n x n matrix. Each element in the matrix is unique and is an integer number between 1 and n2. Now we can perform the operations below in any amount and any order.We pick any two integers x and y that are in the matrix, where ... Read More

C++ Program to find out the total cost required for a robot to make a trip in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Feb-2022 10:05:21

196 Views

Suppose, we are given a grid of dimensions h x w. Each cell in the grid contains some positive integer number. Now there is a path-finding robot placed on a particular cell (p, q) (where p is the row number and q is the column number of a cell) and ... Read More

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

691 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

503 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

124 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

317 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

472 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

277 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

378 Views

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

Advertisements