Arnab Chakraborty has Published 3734 Articles

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

Arnab Chakraborty

Arnab Chakraborty

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

477 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

517 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

283 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 Out the Edges that Disconnect the Graph in Python

Arnab Chakraborty

Arnab Chakraborty

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

350 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

971 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

245 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

229 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

Program to find out the efficient way to study in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:51:27

121 Views

Suppose, we have three lists whose lengths are same. These are deadlines, credits, and durations. They are representing course assignments. For the i−th assignment deadlines[i] shows its deadline, credits[i] shows its credit, and durations[i] shows the number of days it takes to finish the assignment. One assignment must be completed ... Read More

Program to find maximum value by inserting operators in between numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:49:50

383 Views

Suppose we have a list of numbers called nums, we have to find the maximal value that can be generated by adding any binary operators like +, −, and * between the given numbers as well as insert any valid brackets.So, if the input is like nums = [−6, −4, ... Read More

Advertisements