Arnab Chakraborty has Published 4452 Articles

Program to find out the minimum path to deliver all letters in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:51:28

121 Views

Suppose there are n cities and that are connected with n -1 roads. A city can be visited from any other city. Now the postal system of the cities delivers k letters daily. The letter's destination can be any of the k different cities. A postal worker has to deliver ... Read More

Program to find out special types of subgraphs in a given graph in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:48:43

391 Views

Suppose we have a special type of graph that has two types of vertices that are named head and feet. The graph has only one head and there are k edges that connect the head to each of the feet. So, if we are given an undirected, unweighted graph; we ... Read More

Program to find out the minimum cost path between the lowest value vertex to the highest value vertex (Python)

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:44:27

305 Views

Suppose we are given an undirected, weighted graph and are asked to find out the path with the minimum possible travel cost from a particular node to another particular node. The travel cost is calculated as the following: suppose there is a path between vertex A to vertex C as ... Read More

Program to find number of ways to split array into three subarrays in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:39:56

633 Views

Suppose we have an array called nums, we have to find the number of good ways to split this array nums. Answer may be too large so return result modulo 10^9 + 7. Here a split of an array (with integer elements) is good if the array is split into ... Read More

Program to find out the path between two vertices in a graph that has the minimum penalty (Python)

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:36:32

298 Views

Suppose we are given an undirected, weighted graph and are asked to find out the path with the minimum possible penalty from node a to node b. The penalty of a path is the bitwise OR of the weights of all the edges in the path. So, we must find ... Read More

Program to find out the minimum size of the largest clique in a graph (Python)

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:22:51

159 Views

Suppose we are given a graph and are asked to find out the minimum size of the largest clique in the graph. A clique of a graph is a subset of a graph where every pair of vertices are adjacent, i.e. there exists an edge between every pair of vertices. ... Read More

Program to find out an MST using Prim's algorithm in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:19:34

2K+ Views

Suppose we are given a graph and asked to find out the 'Minimum Spanning Tree' (MST) from that graph. An MST of a graph is a subset of a weighted graph where all the vertices are present and connected, and there exists no cycle in the subset. MST is called ... Read More

Program to find out the minimum moves in a snakes and ladders game in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:10:39

827 Views

Suppose we are playing a game of snakes and ladders. We have a condition that we can roll any number that we can like on a dice. We start from position 0 and our destination is position 100, and we roll the dice several times to reach the destination. We ... Read More

Program to count good meals with exactly two items in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 12:10:13

213 Views

Suppose we have an array deli where deli[i] is the deliciousness of the ith food, we have to find the number of different good meals we can make from this list. If the answer is too large, then return result modulo 10^9 + 7. Here a good meal means a ... Read More

Program to find maximum number of eaten apples in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 11:51:42

280 Views

Suppose we have two arrays called days and apples of same length n. There is a special kind of apple tree that grows apples every day for n consecutive days. On the ith day, it grows apples[i] number of apples and that will rot after days[i] days, so we can ... Read More

Advertisements