Arnab Chakraborty has Published 4293 Articles

Program to find out the number of consecutive elements in a matrix whose gcd is greater than 1 in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Oct-2021 07:43:46

203 Views

Suppose we are given a matrix that contains n rows and m columns. We have to find out the largest number of consecutive elements in the matrix where the gcd of the elements is greater than 1. The consecutive elements can either lie horizontally or vertically in the matrix.So, if ... Read More

Program to find length of longest consecutive sublist with unique elements in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 13:43:10

349 Views

Suppose we have a list of numbers called nums, where all elements are unique. We have to find the length of the longest sublist that contains consecutive elements.So, if the input is like nums = [3, 6, 7, 5, 4, 9], then the output will be 5, because the sublist ... Read More

Program to express a positive integer number in words in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 12:54:22

334 Views

Suppose we are given a positive integer number. We have to spell the number in words; like if a number "56" is given as input the output will be "Fifty-Six". The range of conversion is up to a billion.So, if the input is like input = 5678, then the output ... Read More

Program to find out if a linked list is present in a given binary tree in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 12:48:04

213 Views

Suppose we are given a binary tree that has a root node 'root' and a linked list that has a head node 'head'. We have to find out if that linked list exists in that binary tree. If a set of nodes in the tree have links with each other ... Read More

Program to find out the largest sum value of a BST in a given binary tree in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 12:43:31

210 Views

Suppose we are provided a binary tree. We have to find out if there exist binary search trees (BST) in the subtrees of it and find out the sum of the largest BST. To find out the sum, we add the values of each node in that BST. We return ... Read More

Program to find out if a BST is present in a given binary tree in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 12:29:28

169 Views

Suppose we are given a binary tree. We have to find out the largest subtree from the tree that is a binary search tree (BST). We return the root node of the BST.So, if the input is likethen the output will be −To solve this, we will follow these steps ... Read More

Program to find out the k-th smallest difference between all element pairs in an array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 12:19:45

381 Views

Suppose we are given a list containing several integer numbers. We have to find out the difference between each pair of values in the array and find out the k-th smallest difference number. The index starts at 0 and the value k is given to us as input.So, if the ... Read More

Program to find out the k-th largest product of elements of two arrays in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 12:16:12

244 Views

Suppose we are given two lists, p and q that contain some integer numbers. We have to multiply all the values of these lists and have to find out the k-th largest value from the multiplication results.So, if the input is like p = [2, 5], q = [6, 8], ... Read More

Program to find how many lines intersect in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 12:11:03

531 Views

Suppose we are given a list that contains values in pairs of (m, c). These values represent a line, where y = mx + c. We are also given two values, l, and r. We have to find out the number of the lines that intersect with each other between ... Read More

Program to find out the total number of characters to be changed to fix a misspelled word in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Oct-2021 11:46:14

163 Views

Suppose we are given a list of cities and a list of roads that connect each other. The list 'cities' contain the name of cities that a tour bus visits in order. In the list 'roads' the roads are listed in a (source, destination) order meaning there is a one-way ... Read More

Advertisements