Arnab Chakraborty has Published 4293 Articles

Program to Find Out the Maximum Points From Removals in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:16:35

265 Views

Suppose we are provided with a list of positive numbers. Now, here we can remove any contiguous sub list of some length t with the same value and get points t * t. One condition is to be considered, that we can perform this any number of times until the ... Read More

Program to Find Out the Largest K-Divisible Subsequence Sum in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:14:03

433 Views

Suppose we are given a list of non−negative numbers, and a positive value k. We have to find the maximum sum subsequence of numbers such that the sum is divisible by k.So, if the input is like, nums = [4, 6, 8, 2], k = 2, then the output will ... Read More

Program to Find the longest subsequence where the absolute difference between every adjacent element is at most k in Python.

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:12:14

478 Views

Suppose we are given a list of numbers and another value k. This time our task is to find the length of the longest subsequence where the absolute difference between every adjacent element is at most k.So, if the input is like nums = [5, 6, 2, 1, −6, 0, ... Read More

Program to Find K-Largest Sum Pairs in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:09:00

243 Views

Suppose, we have been provided with two lists of numbers that are nums0 and nums1, and an integer k. Our goal is to find the k largest sum pairs where each pair contains one integer in nums0 and another in nums1. The sum of all of the pairs has to ... Read More

Program to Find the Inverted Inversions in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:06:52

167 Views

Suppose we have been provided with a list of numbers nums. We have to find the number of existing quadruplets (a, b, c, d) such that a < b < c < d and nums[a] < nums[b] and nums[c] > nums[d].The array nums is a permutation of the integers 1...NSo, ... Read More

Program to Find Out the Edges that Disconnect the Graph in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:04:55

319 Views

Suppose we have been provided with an undirected graph that has been represented as an adjacency list, where graph[i] represents node i's neighbor nodes. We have to find the number of edges that satisfies the following condition.If the edge is removed, the graph becomes disconnected.So, if the input is like ... Read More

Program to Find Out the Occurrence of a Digit from a Given Range in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:01:25

864 Views

Suppose we have been provided with two positive integers n and d where d is a digit within 0 to 9. We have to determine how many times the digit d appears within the integer numbers between 1 and n.So, if the input is like n = 45, d = ... Read More

Program to Find Out Currency Arbitrage in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 13:00:12

1K+ Views

Suppose we have one N x N table of currency exchange rates. We have to check whether there is some sequence of trades we can make or not. Now starting with some amount A of any currency, we can end up with some amount greater than A of that currency. ... Read More

Program to Connect a Forest in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:57:59

209 Views

Suppose we have graphs as an adjacency lists. This graph is actually a set of disjoint trees. We have to add a certain number of edges to the forest such that it becomes a single tree. We have to return the minimum distance possible of the longest path between any ... Read More

Program to Find Out the Best Interval to Remove in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:54:00

196 Views

Suppose we have a list of intervals (inclusive) that are potentially overlapping. Now consider there is an operation where we delete one interval, then merge the remaining intervals and then count the number of intervals left over. We have to find the maximum number of leftover intervals possible after removal.So, ... Read More

Advertisements