Arnab Chakraborty has Published 4293 Articles

Program to find smallest difference between picked elements from different lists in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Dec-2020 06:08:58

172 Views

Suppose we have a list of lists, we have to find the smallest difference that can be formed by picking one value from each of the lists and taking the difference between the maximum and the minimum number of the picked element.So, if the input is like lists = [ ... Read More

Program to find minimum digits sum of deleted digits in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:19:53

168 Views

Suppose we have two strings s and t of digits, we have to find a way to remove digits in the strings so that: 1. Two strings are same 2. The sum of the digits that are deleted is minimized Finally return the minimized sum.So, if the input is like ... Read More

Program to count number of minimum swaps required to make it palindrome in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:19:13

401 Views

Suppose we have a string s, we have to find the minimum number of adjacent swaps needed to make it into a palindrome. If there is no such way to solve, then return -1.So, if the input is like s = "xxyy", then the output will be 2, as we ... Read More

Program to find minimum possible difference of indices of adjacent elements in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:18:31

255 Views

Suppose we have a list of numbers nums, we can say that two numbers nums[i] ≤ nums[j] are adjacent when there is no number in between (nums[i], nums[j]) in nums. We have to find the minimum possible |j - i| such that nums[j] and nums[i] are adjacent.So, if the input ... Read More

Program to count number of words we can generate from matrix of letters in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:17:50

275 Views

Suppose we have a 4 x 4 board of letters and a list of words, we have to find the largest number of words that can be generated in the board by a sequence of adjacent letters, using one cell at most once per word (but we can reuse cells ... Read More

Program to find intervals by merging target interval in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:16:58

163 Views

Suppose we have a list of non-overlapping intervals. These are sorted based on end time. We have another interval target, find final interval after merging target so that intervals are still non-overlapping and sorted.So, if the input is like intervals = [[1, 15], [25, 35], [75, 90]], target = [10, ... Read More

Program to find list of elements which are less than limit and XOR is maximum in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:16:11

189 Views

Suppose we have a list of numbers nums and a list of queries where each query contains [x, limit]. We have to find a list such that for each query [x, limit], we find an element e in nums such that e ≤ limit and e XOR x is maximized. ... Read More

Program to find length of subsequence that can be removed still t is subsequence of s in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:15:18

210 Views

Suppose we have a string s and another string t. And t is a subsequence of s. We have to find the maximum length of a substring that we can remove from s so that, t is still a subsequence of s.So, if the input is like s = "xyzxyxz" ... Read More

Program to find maximum possible value of smallest group in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:14:34

282 Views

Suppose we have a list of numbers called nums and another value k. We have to split the list into k contiguous groups. The smallest group is the one whose sum is the smallest out of all the groups. So find the maximum possible value of the smallest group.So, if ... Read More

Program to find how max score we can get by removing 10 or 01 from binary string in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2020 10:13:26

363 Views

Suppose we have a binary string s and two values zero_one and one_zero. Now let us consider an operation where we can delete any substring "01" and receive zero_one points. Or we can remove any substring "10" and receive one_zero points. We have to find the maximum number of points ... Read More

Advertisements