Arnab Chakraborty has Published 3734 Articles

Minimum edges required to add to make Euler Circuit in Python

Arnab Chakraborty

Arnab Chakraborty

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

255 Views

Suppose we have an undirected graph of b number of nodes and a number of edges; we have to find minimum edges needed to build Euler Circuit in this graph.So, if the input is likethen the output will be 1.To solve this, we will follow these steps −Define a function ... Read More

Find the winner of a game where scores are given as a binary string in Python

Arnab Chakraborty

Arnab Chakraborty

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

310 Views

Suppose we have one binary string representing the scores of a volleyball match, we have to find the winner of the match based on following conditions −There are two teams play with each other and the team which scores 15 points first will be the winner except when both teams ... Read More

Find the winner by adding Pairwise difference of elements in the array until Possible in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 12:36:39

189 Views

Suppose we have an array A of positive integers, the elements are unique, now, two players P and Q are playing a game. At each move, any one player picks two numbers a and b from the array and if |a – b| is not in the array after that ... Read More

Minimum Cuts can be made in the Chessboard such that it is not divided into 2 parts in Python

Arnab Chakraborty

Arnab Chakraborty

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

132 Views

Suppose we have one A x B chessboard (matrix), we have to calculate the maximum numbers of cuts that we can make in this board so that the board is not divided into 2 parts.So, if the input is like A = 2 and B = 4, then the output ... Read More

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

153 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

259 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

418 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

496 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

1K+ 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

198 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

Advertisements