Arnab Chakraborty has Published 4452 Articles

Program to find number of unique people from list of contact mail ids in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 11:37:19

167 Views

Suppose we have a list of mail ids in a constants list. So for each row there may be more than one mail id of same person. The contact i is considered as duplicate when there's any j, where j < i such that contact j shares a common email ... Read More

Program to check words can be found in matrix character board or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 11:31:36

395 Views

Suppose we have a matrix character board. Where each cell is holding a character. We also have a string called target, we have to check whether the target can be found in the matrix by going left-to-right, or up-to-down unidirectional way, or not.So, if the input is likeantsspinlapsWord = “tip”then ... Read More

Program to find maximum profit we can make by holding and selling profit in Python

Arnab Chakraborty

Arnab Chakraborty

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

566 Views

Suppose we have a list of numbers called nums, that is representing stock prices of a company in chronological order. We can buy at most one share of stock per day, but you can hold onto multiple stocks and can sell stocks on any number of days. Return the maximum ... Read More

Program to find minimum time required to complete tasks with k time gap between same type tasks in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 11:06:07

329 Views

Suppose we have a list of integers called tasks where each item represents a different task type, we also have a non-negative integer say k. Each task takes one unit of time to complete and the tasks must be completed in correct order, but we must have k units of ... Read More

Program to find array by swapping consecutive index pairs in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 11:03:24

360 Views

Suppose we have a list of numbers called nums, we have to return the list by swapping each consecutive even indexes with each other, and swapping each consecutive odd indexes with each other.So, if the input is like nums = [8, 5, 3, 4, 8, 9, 3, 6, 4, 7], ... Read More

Program to check two strings can be equal by swapping characters or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 10:35:29

611 Views

Suppose we have two lowercase strings s and t, they are of the same length. We can select one character from s and another from t and swap them. We can do this operation any number of times we want. Finally, we have to check whether it's possible to make ... Read More

Program to check sum of two numbers is up to k from sorted List or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 10:32:25

461 Views

Suppose we have a list of numbers called nums and the elements in nums are sorted in ascending order. We also have another value k, we have to check whether any two elements taken from the list add up to k or not. The numbers can also be negative or ... Read More

Program to find sum of two numbers which are less than the target in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 10:29:01

539 Views

Suppose we have a list of numbers called nums and also have a target value, we have to find the sum of the largest pair of numbers in nums whose sum is at most (target-1).So, if the input is like nums = [8, 3, 4, 9, 2] target = 8, ... Read More

Program to create data structure to check pair sum is same as value in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 10:24:49

54 Views

Suppose we want to make a data structure that has two methods −add(val) this adds the value val to the data structurefind(val) this checks whether there are two elements whose sum is val or notWe have to design this so that we can get the result on the fly. We ... Read More

Program to check typed string is for writing target string in stuck keyboard keys or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 14-Oct-2021 10:19:08

127 Views

Suppose we have two strings s and t. We want to form t, but there are some problems in the keyboard where some of characters stuck so they may be written 1 or more times. We have to check whether it's possible that typed s was meant to write t ... Read More

Advertisements