Arnab Chakraborty has Published 4293 Articles

Find the value of the function Y = (X^6 + X^2 + 9894845) % 981 in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:34:32

110 Views

Suppose we have given function like f(x) = (x^6 + x^2 + 9894845) % 971, now for a given value of x, we have to find the value of f(x).So, if the input is like 5, then the output will be 469To solve this, we will follow these steps −Define ... Read More

Minimum Cost to cut a board into squares in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:34:12

214 Views

Suppose we have a board of length p and width q; we have to break this board into p*q number of squares such that cost of breaking is as minimum as possible. Cutting cost for each edge will be given.So, if the input is like X_slice = [3, 2, 4, ... Read More

Find the time which is palindromic and comes after the given time in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:31:55

374 Views

Suppose we have a string s that represents a time in the 24 hours format as HH:MM so that HH will be in range 0 to 23 and MM will be in range 0 to 59, We have to find the next closest time which is a palindrome when read ... Read More

Minimum Cost Path with Left, Right, Bottom and Up moves allowed in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:28:25

437 Views

Suppose we have a 2D array. Where each cell of which consists number cost which represents a cost to visit through that cell, we have to find a path from top-left cell to bottom-right cell by which total cost consumed is minimum.So, if the input is like32101661319111448158710111141751234891254221141100331124221then the output will ... Read More

Find the Surface area of a 3D figure in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:27:40

979 Views

Suppose we have a N*M matrix A, this is the representation of 3D figure. The height of the building at point (i, j) is A[i][j]. We have to find the surface area of the figure.So, if the input is like N = 3, M = 3, A = [[1, 4, ... Read More

Find the sums for which an array can be divided into subarrays of equal sum in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:24:16

164 Views

Suppose we have an array of integers A; we have to find all the values for sum so that for a value sum[i] the array can be divided into sub-arrays of sum sum[i]. If we cannot divide the array into sub-arrays of equal sum then return -1.So, if the input ... Read More

Minimize (max(A[i], B[j], C[k]) – min(A[i], B[j], C[k])) of three different sorted arrays in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:24:04

269 Views

Suppose we have three sorted arrays A, B, and C (these can be of different sizes), we have to find compute the minimum absolute difference between the maximum and minimum number of any triplet (A[i], B[j], C[k]) such that they are under arrays A, B and C respectively, So, if ... Read More

Find the sum of maximum difference possible from all subset of a given array in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:21:07

423 Views

Suppose we have an array A of n values (elements may not be distinct). We have to find the sum of maximum difference possible from all subsets of given array. Now consider max(s) denotes the maximum value in any subset, and min(s) denotes the minimum value in the set. We ... Read More

Find the sum of all Truncatable primes below N in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:18:47

291 Views

Suppose we have a given integer N; we have to find the sum of all Truncatable primes less than N. As we know the truncatable prime is a number which is left-truncatable prime (if the leading "left" digit is successively removed, then all resulting numbers are treated as prime) as ... Read More

Minimize (max(A[i], B[j], C[k]) – min(A[i], B[j], C[k])) of three different sorted arrays in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:17:27

496 Views

ConceptWith respect of given three sorted arrays A, B, and C of not necessarily same sizes, compute the lowest i.e. minimum absolute difference between the maximum and minimum number of any triplet A[i], B[j], C[k] such that they are under arrays A, B and C respectively, i.e., minimize (max(A[i], B[j], ... Read More

Advertisements