Arnab Chakraborty has Published 3734 Articles

Program to find minimum amplitude after deleting K elements in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 11:16:38

543 Views

Suppose we have a lit of numbers called nums, and have another value k. If we remove k elements from nums, then find the minimum of (maximum of nums - minimum of nums).So, if the input is like nums = [4, 10, 3, 2, 8, 9] k = 3, then ... Read More

Program to find maximum product of two distinct elements from an array in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 11:09:04

1K+ Views

Suppose we have a list of numbers called nums, we have to find the largest product of two unique elements.So, if the input is like nums = [8, -3, 1, -5], then the output will be 15, (-3)*(-5) = 15 which is maximum here.To solve this, we will follow these ... Read More

Program to find largest product of three unique items in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 11:07:51

415 Views

Suppose we have a list of numbers called nums, we have to find the largest product of three unique elements.So, if the input is like nums = [6, 1, 2, 4, -3, -4], then the output will be 72, as we can multiply (- 3) * (-4) * 6 = ... Read More

Program to find maximum sum of multiplied numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 11:05:57

387 Views

Suppose we have two lists called nums and multipliers. Now consider an operation where we can remove any number from nums and remove any number from multipliers then multiply them together. We must repeat this operation until one of the lists is empty, we have to find the maximum sum ... Read More

Program to find maximum distance between empty and occupied seats in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 11:03:21

576 Views

Suppose we have a list with only 0s and 1s called seats. Where seats[i] represents a seat. When it is 1, then it is occupied, otherwise free. There is at least one free seat and at least one occupied seat, we have to find the maximum distance from a free ... Read More

Program to count number of BST with n nodes in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 09:46:13

361 Views

Suppose we have n different nodes. All are distinct. We have to find how many number of ways we can arrange them to form Binary search tree. As we know for binary search trees, the left subtree always hold smaller values and right subtrees hold the greater values.To solve this, ... Read More

Program to filter all values which are greater than x in an array

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 09:38:55

724 Views

Suppose we have a list of numbers called nums. We also have another number x. We have to find all numbers from nums which are less than x by filtering. In we use python there is one filter() method that takes function as argument and filter using this function.So, if ... Read More

Program to find replicated list by replicating each element n times

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 09:36:55

574 Views

Suppose we have a list of n elements; we have to repeat each element in the list n number of times.So, if the input is like nums = [1, 5, 8, 3], then the output will be [1, 1, 1, 1, 5, 5, 5, 5, 8, 8, 8, 8, 3, ... Read More

Program to find super digit of a number in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 09:36:13

3K+ Views

Suppose we have a number n. We have to find the super digit of this number. The super digit of a single digit number is the digit itself but for multi-digit numbers super digit is the sum of all digits repeatedly until the sum is a single digit number.So, if ... Read More

Program to find number of values factors of two set of numbers

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Oct-2021 09:33:33

115 Views

Suppose we have two arrays called nums1 and nums2. We have to find the number of values that satisfy the following conditions −The elements in nums1 are the factors of the elements which are being selectedThe elements which are selected is a factor of all of the elements of nums2So, ... Read More

Advertisements