Arnab Chakraborty has Published 4293 Articles

Program to find minimum number of groups in communication towers in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:33:18

211 Views

Suppose we have a 2D binary matrix where 1 represents a communication tower, and 0 represents an empty cell. The towers can communicate in the following ways: 1. If tower A, and tower B are either on the same row or column, they can communicate with each other. 2. If ... Read More

Program to find angle between hour and minute hands of a clock in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:26:28

2K+ Views

Suppose we have two values hours and minutes. We have to find a smaller angle formed between the hour and the minute hand.So, if the input is like hour = 12 minutes = 45, then the output will be 112.5To solve this, we will follow these steps:if h = 12, ... Read More

Program to find maximum number of courses we can take based on interval time in Python?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:24:08

264 Views

Suppose we have a list of intervals in the form [start, end], this is representing the start and end time of a course. We have to find the maximum number of courses we can take, assuming we can only take one course at a time and the start of a ... Read More

Program to find number of boxes that form longest chain in Python?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:21:39

228 Views

Suppose we have a list of boxes, here each entry has two values [start, end] (start < end). We can join two boxes if the end of one is equal to the start of another. We have to find the length of the longest chain of boxes.So, if the input ... Read More

Program to check whether first player win in candy remove game or not in Python?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:17:11

200 Views

Suppose we have a list of numbers called candies and someone is playing a game against his/her friend. In each round, a player can remove any two consecutive candies with the same value. And whoever can not pick up a candy loses and that player1 start first, we have to ... Read More

Program to evaluate Boolean expression from a string in Python?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:15:08

911 Views

Suppose we have a string s containing a boolean expression with operators "and" and "or", evaluate it and return the result. Here the expressions may have parentheses, which should be evaluated first.So, if the input is like s = "T and (F or T)", then the output will be TrueTo ... Read More

Program to find minimum bus fare for travelling all days in Python?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:10:37

967 Views

Suppose we have a list of sorted numbers called days, where we must take the bus for on each day. We have to find the lowest cost it takes to travel for all the days. There are 3 types of bus tickets. 1-day pass for 2 bucks 7-day pass for ... Read More

Program to count number of swaps required to change one list to another in Python?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:07:36

419 Views

Suppose we have two lists of numbers L1 and L2, the length of each list is n and each value is unique to its list, and values are in range 1 to n, we have to find the minimum number of adjacent swaps required to transform L1 to L2.So, if ... Read More

Program to find maximum profit we can get by buying and selling stocks with a fee in Python?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:05:39

191 Views

Suppose we have a list of stock prices of a company in chronological sequence, and also have the transaction fee for one sell transaction. We have to find the maximum profit we could have made from buying and selling that stock any number of times. We must buy before we ... Read More

Program to find maximum number enemies will be killed to place a bomb in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Nov-2020 08:03:05

458 Views

Suppose we have a 2D matrix of three different values, 2s, 1s, and 0s, where a 2 represents an enemy, 1 represents a wall and 0 represents an empty cell. We have to find the maximum enemies we can kill using one bomb. The bomb kills all the enemies in ... Read More

Advertisements